import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static int toInt(String str){ final String[] arr = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; for(int i = 0; i < 12; i++){ if(str.equals(arr[i])){ return i; } } return 0; } public static String toStr(final int i){ return new String[]{"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}[i]; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int S = toInt(sc.next()); final int T = sc.nextInt(); int ans_int = S; while(ans_int < 0){ ans_int += 12; } ans_int += 12; ans_int += T; while(ans_int < 0){ ans_int += 12; } ans_int %= 12; System.out.println(toStr(ans_int)); } }