#include using namespace std; typedef unsigned long long ull; typedef long long ll; string st[]={"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int main(){ string s; int t; cin >> s >> t; while(t<0) t+=12; int now; for(int i=0; i<12; i++){ if(s==st[i]) now=i; } cout << st[(now+t)%12] << endl; return 0; }