import sequtils, strutils, sugar var n = parseInt readLine stdin list = [ (720, 'C'), (360, 'M'), (180, 'S'), (30, 'R'), (6, 'o'), (1, '.') ] ss = newSeq.collect: for (x, c) in list: let k = n div x n = n mod x c.repeat k echo ss.join