using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol = new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ Dictionary dic = new Dictionary(){ {"I",1}, {"II",2}, {"III",3}, {"IIII",4}, {"V",5}, {"VI",6}, {"VII",7}, {"VIII",8}, {"IX",9}, {"X",10}, {"XI",11}, {"XII",0}, }; String[] dic2 = new String[12]; foreach(var s in dic.Keys) dic2[dic[s]] = s; Console.WriteLine(dic2[(dic[S]+N+1200000)%12]); } String S; int N; public Sol(){ var ss = rsa(); S = ss[0]; N = int.Parse(ss[1]); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);} static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }