Plus
Pin


Problem description Progress
ID 37170. Insertion sort
Темы: Insertion sort   

It is required to sort the array in non-descending order using the "inserts" method.

Input 
The first line contains one natural number N not exceeding 1000 – array size. The second line sets N numbers – array elements (integers not exceeding 1000 in absolute value).

Imprint 
Output the resulting array.
 
Example
# Input Output
1 5
5 4 3 2 1
1 2 3 4 5