x=['I','II','III','IIII','V','VI','VII','VIII','IX','X','XI','XII'] s,t=map(str,input().split()) print(x[(x.index(s)+int(t))%12])