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