n=int(input()) d=[1,6,30,180,360,720] s=[*'.oRSMC'] ans='' while d and s: i,j=d.pop(),s.pop() k=n//i n%=i ans+=j*k print(ans)