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