import java.util.*; public class Main { public static void main(String[] args) throws Exception { // Your code here! Scanner sc=new Scanner(System.in); String[] line; String result=""; line=sc.nextLine().split(" "); String[] rome={"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int now=0; while(!rome[now].equals(line[0])){ now++; } int time=Integer.parseInt(line[1]); while(time<0) time+=12; now=(now+time)%12; result=rome[now]; System.out.println(result); } }