// Sorts three user-specified numbers 	
	
import java.io.*;	
	
public class SortThree {	
	// main(): application entry point	
	public static void main(String[] args) throws IOException {	
		// set input stream	
		BufferedReader stdin = new BufferedReader(	
				new InputStreamReader(System.in));	
			
		// extract inputs	
		System.out.println("Enter three integers one per line:");	
		String s1 = stdin.readLine();	
		String s2 = stdin.readLine();	
		String s3 = stdin.readLine();	
	
		// did we get three inputs	
		if ((s1 == null) || (s2 == null) || (s3 == null)) {	
			System.out.println("Cannot sort without three inputs");

			System.exit(1);	
		}	
	
		// convert the inputs into numeric form	
		int n1 = Integer.parseInt(s1);	
		int n2 = Integer.parseInt(s2);	
		int n3 = Integer.parseInt(s3);	
	
		// define outputs	
		int o1;	
		int o2;	
		int o3;	
	
		// determine which of the six orderings is applicable	
		if ((n1 <= n2) && (n2 <= n3)) {  // n1 <= n2 <= n2	
			o1 = n1;	
			o2 = n2;	
			o3 = n3;	
		}	
		else if ((n1 <= n3) && (n3 <= n2)) { // n1 <= n3 <= n2	
			o1 = n1;	
			o2 = n3;	
			o3 = n2;	
		}	
		else if ((n2 <= n1) && (n1 <= n3)) { // n2 <= n1 <= n3	
			o1 = n2;	
			o2 = n1;	
			o3 = n3;	
		}	
		else if ((n2 <= n3) && (n3 <= n1)) { // n2 <= n3 <= n1	
			o1 = n2;	
			o2 = n3;	
			o3 = n1;	
		}	
		else if ((n3 <= n1) && (n1 <= n2)) { // n3 <= n1 <= n2	
			o1 = n3;	
			o2 = n1;	
			o3 = n2;	
		}	
		else { // n3 <= n2 <= n1	
			o1 = n3;	
			o2 = n2;	
			o3 = n1;	
		}	
	
		// display results	
		System.out.println("\n" + n1 + " " + n2 + " " + n3	
		   + " in sorted order is " + o1 + " " + o2 + " " + o3);	
	}	
}	
