import java.util.*; public class Test10 { public static void main(String[] args){ String[] exchange={ "XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI" }; Scanner sc=new Scanner(System.in); String[] line; line=sc.nextLine().split(" "); int h=-1; for(int i=0;i<12;i++){ if(line[0].equals(exchange[i])){ h=(i+Integer.parseInt(line[1]))%12; break; } } if(h<0) h+=(h-11)/-12*12; System.out.println(exchange[h]); } }