l = ["I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"] * 100 s, t = input().split() x = l.index(s) + int(t) print(l[x])