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