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 + 1; } } if(time + t >= 0) { time = (time + t) % 12; } else if(time + t < 0) { time = 12 - Math.abs((time + t)) % 12; } System.out.println(x[time - 1]); } }