r='I II III IIII V VI VII VIII IX X XI XII'.split()*100;s,t=input().split();print(r[r.index(s)+int(t)])