import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.List; public class No00000405_Main2 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static List romeArr = Arrays.asList("I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"); public static void main(String[] args) throws IOException { String[] arr = br.readLine().split(" "); System.out.println(romeArr.get((((romeArr.indexOf(arr[0]) + Integer.parseInt(arr[1])) % 12) + 12) % 12)); } }