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.

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 the stalin sorted list, with one integer per line.

`5`

6

7

3

2

9

`6`

7

9

`3`

3

2

1

`3`

- Points: 5
- Time limit: 1.0s
- Memory limit: 64.0M
- Author: enigma
- Category: Classics
- Type: Implementation
- All Submissions Best Submissions

Comments

- There are no comments.