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