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