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