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