#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, index; cin >> s >> t; for (int i=0; i<12; i++) { if (v[i]==s) { index=i; } } if (t>=0) { printf("%s\n", v[(index+t)%12].c_str()); } else { printf("%s\n", v[12-(index-t)%12].c_str()); } }