N=int(input()) ans="" for s,x in zip("CMSRo.",(720,360,180,30,6,1)): ans+=s*(N//x) N%=x print(ans)