import java.util.Scanner; public class b { public static void main(String args[]){ Scanner sc = new Scanner(System.in); String foo[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; String s = sc.next(); int t = sc.nextInt(); int i = 0; while(true){ if(foo[i].equals(s)) break; i++; } System.out.println(foo[(i + t) % 12]); } }