import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No405 { public static void main(String[] args) throws IOException{ String[] romeNum = {"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; String[] temp = new BufferedReader(new InputStreamReader(System.in)).readLine().split(" "); int nowTime = getTime(romeNum, temp[0]); System.out.println(romeNum[getAnswerTime(nowTime,temp[1])]); } public static int getTime(String[] a, String b){ int time = 0; for(int i=0; i< a.length; i++){ if(a[i].equals(b)) time = i; } return time; } public static int getAnswerTime(int a,String b){ int pastTime = Integer.parseInt(b); int answerTime = (a + pastTime) % 12; if(answerTime < 0) answerTime += 12; return answerTime; } }