#include #include using namespace std; int main(){ string S; int T; cin>>S>>T; if(S=="I") T+=1; else if(S=="II") T+=2; else if(S=="III") T+=3; else if(S=="IIII") T+=4; else if(S=="V") T+=5; else if(S=="VI") T+=6; else if(S=="VII") T+=7; else if(S=="VIII") T+=8; else if(S=="IX") T+=9; else if(S=="X") T+=10; else if(S=="XI") T+=11; else if(S=="XII") T+=12; while(T<=0||T>=13){ if(T<=0) T+=12; if(T>=13) T-=12; } if(T==1) cout<<"I"<