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