Problem:
Sorting Three Numbers

Write a program which reads three integers, and prints them in ascending order.

Input

Three integers separated by a single space are given in a line.

Output

Print the given integers in ascending order in a line. Put a single space between two integers.

Constraints

1 ≤ the three integers ≤ 10000

Sample Input 1

3 8 1

Sample Output 1

1 3 8

Solution in JAVA (judge verdict: Accepted)

import java.util.ArrayList;
import java.util.Scanner;

class SortingThreeNumbers extends ArrayList<Integer> {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public SortingThreeNumbers(int n1, int n2, int n3) {
		add(n1);
		add(n2);
		add(n3);
	}
	
	public SortingThreeNumbers sort() {
		sort(null);
		return this;
	}
	
	public String toString() {
		return get(0) + " " + get(1) + " " + get(2);
	}
}

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		SortingThreeNumbers sortingThreeNumbers
			= new SortingThreeNumbers(scan.nextInt(), scan.nextInt(), scan.nextInt());
		System.out.println(sortingThreeNumbers.sort().toString());
	}

}