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