import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main{ static Scanner s=new Scanner(System.in); public static void main(String __[]){ input(); solve(); } static List list=Arrays.asList("I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"); static String s1; static int t; private static void input(){ s1=s.next(); t=s.nextInt(); } private static void solve(){ System.out.println(list.get((list.indexOf(s1)+1200+t)%12)); } }