s = '.oRSMC' a = [1, 6, 30, 180, 360, 720] n = int(input()) for x, c in zip(a[::-1], s[::-1]): print(c*(n//x), end='') n %= x