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