import java.io.*;
import java.util.Scanner;
class Ideone
{
/**
Convert decimal number lying between 1-3999 to roman numerals
SYMBOL VALUE
I 1
II 2
III 3
IV 4
V 5
X 10
L 50
C 100
D 500
M 1000
**/
private static String roman
(int n
) {
String[] thousands
={"",
"M",
"MM",
"MMM"}; String[] hundreds
={"",
"C",
"CC",
"CCC",
"CD",
"D",
"DC",
"DCC",
"DCCC",
"CM"}; String[] tens
={"",
"X",
"XX",
"XXX",
"XL",
"L",
"LX",
"LXX",
"LXXX",
"XC"}; String[] ones
={"",
"I",
"II",
"III",
"IV",
"V",
"VI",
"VII",
"VIII",
"IX",
"L"};
return thousands[n/1000]+hundreds[(n%1000)/100]+tens[(n%100)/10]+ones[n%10];
}
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgSWRlb25lCnsKCS8qKgoJQ29udmVydCBkZWNpbWFsIG51bWJlciBseWluZyBiZXR3ZWVuIDEtMzk5OSB0byByb21hbiBudW1lcmFscwoJCglTWU1CT0wgICAgICAgVkFMVUUKCUkgICAgICAgICAgICAgMQoJSUkJCQkgIDIKCUlJSQkJCSAgMwoJSVYgICAgICAgICAgICA0CglWICAgICAgICAgICAgIDUKCVggICAgICAgICAgICAgMTAKCUwgICAgICAgICAgICAgNTAKCUMgICAgICAgICAgICAgMTAwCglEICAgICAgICAgICAgIDUwMAoJTSAgICAgICAgICAgICAxMDAwICAgICAKCSoqLwoJcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIHJvbWFuKGludCBuKSB7CgkJCgkJU3RyaW5nW10gdGhvdXNhbmRzID17IiIsICJNIiwgIk1NIiwgIk1NTSJ9OwoJCVN0cmluZ1tdIGh1bmRyZWRzPXsiIiwgIkMiLCAiQ0MiLCAiQ0NDIiwgIkNEIiwgIkQiLCAiREMiLCAiRENDIiwgIkRDQ0MiLCAiQ00ifTsKCQlTdHJpbmdbXS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