import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); StringBuilder sb = new StringBuilder(); while (n >= 720) { n -= 720; sb.append("C"); } while (n >= 360) { n -= 360; sb.append("M"); } while (n >= 180) { n -= 180; sb.append("S"); } while (n >= 30) { n -= 30; sb.append("R"); } while (n >= 6) { n -= 6; sb.append("o"); } while (n > 0) { n -= 1; sb.append("."); } System.out.println(sb.toString()); } }