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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AOZ
{
	class MainClass
	{
		static void Main(string[] args)
		{
			var input_arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			//Bucket
			int max = input_arr.Max();
			int[] bucket = new int[max + 1];
			for (int i = 0; i < input_arr.Length; i++)
			{
				bucket[input_arr[i]]++;
			}
			int[] array = new int[input_arr.Length];
			for (int j = 0, i = 0; j < bucket.Length; j++)
			{
				//j:bucketのindex, i:sort後の配列index ,k:１つのbucket内の要素の数に対するindex
				for (int k = bucket[j]; k != 0; k--, i++)
				{
					array[i] = j;
				}
			}
			Console.WriteLine(string.Join(" ", array));
		}
	}
}