#N,K=map(int, input().split()) #A=list(map(int, input().split())) ans=[] N=int(input()) while N>=720: ans.append('C') N-=720 while N>=360: ans.append('M') N-=360 while N>=180: ans.append('S') N-=180 while N>=30: ans.append('R') N-=30 while N>=6: ans.append('o') N-=6 while N>=1: ans.append('.') N-=1 print(''.join(ans))