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