/* Insertion Sort - P1031
* The algorithm divides the input list into two parts: the sublist of items
* already sorted, which is built up from left to right at the front (left) of
* the list, and the sublist of items remaining to be sorted that occupy the
* rest of the list. Initially, the sorted sublist is empty and the unsorted
* sublist is the entire input list. The algorithm proceeds by finding the
* smallest (or largest, depending on sorting order) element in the unsorted
* sublist, exchanging (swapping) it with the leftmost unsorted element
* (putting it in sorted order), and moving the sublist boundaries one element
* to the right.
*/import java.util.*;
import java.io.*;
import java.math.BigInteger;
publicclassMain
{publicstaticvoidmain(String args[])
{
Scanner cin=new Scanner(System.in);
int[] arr=newint[15];
for(int i=1;i<=10;++i)
{
arr[i]=cin.nextInt();
}
for(int i=1;i<=10;++i)
{
int minId=i;
for(int j=i;j<=10;++j)
if(arr[minId]>arr[j])
minId=j;
swap(arr,minId,i);
}
for(int i=1;i<=10;++i)
System.out.println(arr[i]);
}
// a mainstream implementation due to limitation of Java itself.publicstaticvoidswap(int[] arr, int a, int b) {
int temp = arr[a];
arr[a] = arr[b];
arr[b] = temp;
}
}