import java.io.*;

/**
 * a sort method that can be called from main().
 * @author	Qusay H. Mahmoud
 */
public class Sort2 {

   public static void sort(int a, int b, int c) {
      // now sort the numbers in ascending (increasing) order
      int max;
      if(a > b) {
        max = a;
        a = b;
        b = max;
      }
      if(b > c) {
        max = b;
        b = c;
        c = max;
      }
      if(a > b) {
        max = a;
        a = b;
        b = max;
      }
      System.out.println("The sorted numbers are: "+ a + ", " + b + ", " + c);
   }

   public static void main(String argv[]) throws Exception {
      // connect an input stream to the keyboard
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      // three variables to hold the input
      int a, b, c;
      System.out.print("Enter first number: ");
      // read a number as a string and convert it to an integer value
      a = Integer.parseInt(br.readLine());
      System.out.print("Enter second number: ");
      // read a number as a string and convert it to an integer value
      b = Integer.parseInt(br.readLine());
      // read a number as a string and convert it to an integer value
      System.out.print("Enter third number: ");
      c = Integer.parseInt(br.readLine());
      // this is call by value....a, b, and c will not be changed here.
      sort(a, b, c);
      // in other words, if you print the values of a, b, and c here....they are not sorted
      System.out.println("original values: "+ a + " " + b + " " + c);

   }
}
