roman = ["I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"] s1, t = gets.split puts roman[(roman.index(s1) + t.to_i) % 12]