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