N=int(input()) d={".":1,"o":6,"R":30,"S":180,"M":360,"C":720} for k,v in reversed(d.items()): x=N//v N-=x*v for i in range(x):print(k,end="") print()