#include #include #include #include #include #include #include #include using namespace std; #define REP(i, j) for (int i = 0; i < (int)j; ++i) #define FOR(i, j, k) for (int i = (int)j; i < (int)k; ++i) #define SORT(v) sort(v.begin(), v.end()) #define REVERSE(v) reverse(v.begin(), v.end()) typedef complex P; typedef vector VI; typedef long long LL; typedef pair PII; int main() { cin.tie(0); ios::sync_with_stdio(false); vector ss = {"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; string s1; int t; cin >> s1 >> t; int t0; REP(i,ss.size()) { if (ss[i] == s1) { t0 = i; break; } } int t2; if (t < 0) t2 = 12 - (abs(t0 + t) % 12); else t2 = (t0 + t) % 12; cout << ss[t2] << endl; return 0; }