N = int(input()) ans = [] x = N for c, t in [('C', 720), ('M', 360), ('S', 180), ('R', 30), ('o', 6), ('.', 1)]: d, m = divmod(x, t) ans.append(c * d) x = m print(''.join(ans))