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)])