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