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