R='I II III IIII V VI VII VIII IX X XI XII'.split() S,T=input().split() i=(R.index(S)+int(T))%12 print(R[i])