r = ["I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"] s = input().split() i = (r.index(s[0]) + int(s[1])) % 12 print(r[i])