#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c s{"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; string a;std::cin >> a; ll t;std::cin >> t; t%=12; ll num = 0; for(int i=0;i<12;i++){ if(s[i]==a){ num = i; break; } } num = (num+t)%12; std::cout << s[num] << '\n'; }