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 PHP (judge verdict: Accepted)

<?php
//入力受け取り
$input = trim(fgets(STDIN));
//空白区切の入力を整数値にして、配列$ary に格納。
$ary = sscanf($input, "%d %d %d");

//小さい順で並び替え
if ($ary[0] > $ary[1]) {
    list($ary[0], $ary[1]) = [$ary[1], $ary[0]];
}
if ($ary[1] > $ary[2]) {
    list($ary[1], $ary[2]) = [$ary[2], $ary[1]];
}
if ($ary[0] > $ary[1]) {
    list($ary[0], $ary[1]) = [$ary[1], $ary[0]];
}

echo $ary[0]." ".$ary[1]." ".$ary[2]."\n";