import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String current = sc.next(); String[] romans = new String[]{"XII", "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int next = sc.nextInt(); for (int i = 0; i < romans.length; i++) { if (romans[i].equals(current)) { System.out.println(romans[(i + next + 12 * 100) % 12]); return; } } } }