N = int(input()) ans = [] while N > 0: if N >= 720: ans.append('C') N -= 720 elif N >= 360: ans.append('M') N -= 360 elif N >= 180: ans.append('S') N -= 180 elif N >= 30: ans.append('R') N -= 30 elif N >= 6: ans.append('o') N -= 6 else: ans.append('.') N -= 1 print(''.join(ans))