n=int(input()) l=[720,360,180,30,6,1] s=["C","M","S","R","o","."] ans=[] while n!=0: for i,j in enumerate(l): if n>=j: n-=j ans.append(s[i]) break print(*ans,sep="")