#include #include #include #include #include //--------------------------- using namespace std; //--------------------------- #define REP(i,n) for(int i = 0; i < (n); i++) #define P(x) cout << (x) << "\n" //--------------------------- int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); vector v = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; string s; int t,snum,ans; cin >> s >> t; REP(i,12){ if (s == v[i]) { snum = i + 1; } } ans = (snum + t) % 12; cout << (ans == 0 ? "XII" : v[ans - 1]); return 0; }