S,T = input().split() roma = ["I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"] w = roma.index(S) + int(T) while w > 13 or w < 0: if w > 13: w-=12 elif w < 0: w+=12 print(roma[w])