program pil_7_23(input,output);
label 1;
var
	k : 1..9;
  i : integer;
begin
	Write('Input k : ');
  Read(k);
	case k of
	 	1,2,3 :
1:	        for i:= 1 to k do Write('I');
    4     : Write('IV');
    5     : Write('V');
    6,7,8 : begin
            	Write('V');
              k := k-5;
              goto 1;
            end;
		9      : Write('X');
	end;
  WriteLn;
end.