a=["I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"] b=input().split() c=(a.index(b[0])+int(b[1])+1)%12 print(a[c-1])