import java.util.*; import java.lang.*; import java.io.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); StringBuilder sb = new StringBuilder(); while(n > 0) { String str = ""; int cnt = 0; if(n / 720 >= 1){ str = "C"; cnt = n / 720; n = n - (cnt * 720); }else if(n / 360 >= 1){ str = "M"; cnt = n / 360; n = n - (cnt * 360); }else if(n / 180 >= 1){ str = "S"; cnt = n / 180; n = n - (cnt * 180); }else if(n / 30 >= 1){ str = "R"; cnt = n / 30; n = n - (cnt * 30); }else if(n / 6 >= 1){ str = "o"; cnt = n / 6; n = n - (cnt * 6); }else{ str = "."; cnt = n; n = 0; } for (int i=0; i