n = int(input()) s = "" a = [["C", 720], ["M", 360], ["S", 180], ["R", 30], ["o", 6], [".", 1]] for c, v in a: s += c * (n // v) n %= v print(s)