using System; class Program { static void Main() { var a = Console.ReadLine().Split(' '); var c = new[]{"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int t = 0; for(int i=0;i<13;i++) { if(c[i]==a[0]) { t=i; break; } } t+=int.Parse(a[1])+1200; t%=12; Console.WriteLine(c[t]); } }