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