n = io.read("*n") t = {} a = {720, 360, 180, 30, 6, 1} b = {"C", "M", "S", "R", "o", "."} for i = 1, 6 do while a[i] <= n do table.insert(t, b[i]) n = n - a[i] end end print(table.concat(t))