public static void main(String[] args) {
//		for (int i = 0; i < 4999; i++) {
//			System.out.println(i + ": " + getMinimalForm(i));
//		}
		
		String[] strings = {
				"XXXXVIIII",
				"XXXXIX",
				"XLVIIII",
				"XLIX",
				"IL"
		};
		for(String s : strings){
			System.out.println(getValue(s));
		}
	}