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