s,t=map(str,input().split(" ")) lis=["XII","I","II","III","IV","V","VI","VII","VIII","IX","X","XI"] x=lis.index(s) s2=(x+int(t))%12 print(lis[s2])