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