import java.util.Scanner; public class Main{ public static void main(String[] args) { solver(); } static void solver() { Scanner sc = new Scanner(System.in); String[] s = { "XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI" }; String s1 = sc.next(); int idx = -1; for (int i = 0; i < s.length; i++) { if (s1.equals(s[i])) { idx = i; } } if (idx == -1) { throw new AssertionError(); } int cur = sc.nextInt(); idx += cur; while (idx < 0) { idx += 12; } idx %= 12; System.out.println(s[idx]); } }