#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; string p[14] = { "XII" , "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII" }; int main() { string r; int n; cin >> r >> n; int x = 0; for (int i = 0; i <= 12; i++) { if (p[i] == r) { x = i; break; } } n += x; //n = abs(n); n %= 12; if (n < 0)n += 12; cout << p[n] << endl; return 0; }