import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { String[] table = new String[]{"XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI"}; Map map1 = new HashMap<>(); Map map2 = new HashMap<>(); for (int i = 0; i < table.length; i++) { map1.put(table[i], i); map2.put(i, table[i]); } BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); String S1 = inputs[0]; int T = Integer.parseInt(inputs[1]); System.out.println(map2.get((map1.get(S1) + T + 1200) % 12)); } }