Stalin Sort

Stalin likes keeping order. One day he came across an unordered list. Stalin immidiately decided that the list must be modified to be ordered, but since running an \(O(n log{n})\) algorithm takes up too much power that could be distributed to the workers of the world, he comes up with an althernative algorithm that sends items in the list to gulag if it's out of order.


Input Specifications


The first line of input contains integer \(N\) representing the number of integers in the list. (\(-10^4 < N < 10^4\))

The next \(N\) lines contain a single integer \(N_i\), the items of the list. (\(-10^5 < N_i < 10^5\))


Output Specifications


Output the stalin sorted list, with one integer per line.


Sample Input 1


5
6
7
3
2
9


Sample Output 1


6
7
9


Sample Input 2


3
3
2
1


Sample Output 2


3
Comments
  • There are no comments.