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