n=int(input()) ans="" L=[720,360,180,30,6,1] s="CMSRo." for i in range(6): e=L[i] while e<=n: n-=e ans+=s[i] print(ans)