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