#include using namespace std; typedef long long ll; int main() { string itor[12] = { "I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII" }; map rtoi; for (int i = 0; i < 12; i++) rtoi[itor[i]] = i; string s; int t; cin >> s >> t; cout << itor[(rtoi[s] + t) % 12] << endl; return 0; }