import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s1 = sc.next(); int t = sc.nextInt(); String[] x = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; int time = -101010101; for(int i = 0 ; i < x.length ; i++) { if(x[i].equals(s1)) { time = i; } } time = (time + 1200 + t) % 12; System.out.println(x[time]); } }