import java.io.*; import java.util.StringTokenizer; public class eksam4{ public static void main(String argumendid[]) throws IOException{ BufferedReader sisse=new BufferedReader( new InputStreamReader(System.in) ); System.out.println("Palun number:"); String nr=sisse.readLine(); String y[]={"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};//yhelised String k[]={"X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};//kymnelised String s[]={"C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"};//sajalised String t[]={"M", "MM"};//tuhanded if(nr.length()==4){ if(nr.substring(0,1).equals("1")){System.out.print(t[0]);} if(nr.substring(0,1).equals("2")){System.out.print(t[1]);} if(nr.substring(1,2).equals("1")){System.out.print(s[0]);} if(nr.substring(1,2).equals("2")){System.out.print(s[1]);} if(nr.substring(1,2).equals("3")){System.out.print(s[2]);} if(nr.substring(1,2).equals("4")){System.out.print(s[3]);} if(nr.substring(1,2).equals("5")){System.out.print(s[4]);} if(nr.substring(1,2).equals("6")){System.out.print(s[5]);} if(nr.substring(1,2).equals("7")){System.out.print(s[6]);} if(nr.substring(1,2).equals("8")){System.out.print(s[7]);} if(nr.substring(1,2).equals("9")){System.out.print(s[8]);} if(nr.substring(2,3).equals("1")){System.out.print(k[0]);} if(nr.substring(2,3).equals("2")){System.out.print(k[1]);} if(nr.substring(2,3).equals("3")){System.out.print(k[2]);} if(nr.substring(2,3).equals("4")){System.out.print(k[3]);} if(nr.substring(2,3).equals("5")){System.out.print(k[4]);} if(nr.substring(2,3).equals("6")){System.out.print(k[5]);} if(nr.substring(2,3).equals("7")){System.out.print(k[6]);} if(nr.substring(2,3).equals("8")){System.out.print(k[7]);} if(nr.substring(2,3).equals("9")){System.out.print(k[8]);} if(nr.substring(3,4).equals("1")){System.out.print(y[0]);} if(nr.substring(3,4).equals("2")){System.out.print(y[1]);} if(nr.substring(3,4).equals("3")){System.out.print(y[2]);} if(nr.substring(3,4).equals("4")){System.out.print(y[3]);} if(nr.substring(3,4).equals("5")){System.out.print(y[4]);} if(nr.substring(3,4).equals("6")){System.out.print(y[5]);} if(nr.substring(3,4).equals("7")){System.out.print(y[6]);} if(nr.substring(3,4).equals("8")){System.out.print(y[7]);} if(nr.substring(3,4).equals("9")){System.out.print(y[8]);} } } }