#include using namespace std; int main() { string s; int t; cin >> s >> t; int tm = 1200; if (s == "I") { tm += 1; } else if (s == "II") { tm += 2; } else if (s == "III") { tm += 3; } else if (s == "IIII") { tm += 4; } else if (s == "V") { tm += 5; } else if (s == "VI") { tm += 6; } else if (s == "VII") { tm += 7; } else if (s == "VIII") { tm += 8; } else if (s == "IX") { tm += 9; } else if (s == "X") { tm += 10; } else if (s == "XI") { tm += 11; } else if (s == "XII") { tm += 12; } tm = (t + tm) % 12; if (tm == 0) { cout << "XII" << endl; } else if (tm == 1) { cout << "I" << endl; } else if (tm == 2) { cout << "II" << endl; } else if (tm == 3) { cout << "III" << endl; } else if (tm == 4) { cout << "IIII" << endl; } else if (tm == 5) { cout << "V" << endl; } else if (tm == 6) { cout << "VI" << endl; } else if (tm == 7) { cout << "VII" << endl; } else if (tm == 8) { cout << "VIII" << endl; } else if (tm == 9) { cout << "IX" << endl; } else if (tm == 10) { cout << "X" << endl; } else { cout << "XI" << endl; } return 0; }