LogiQuest

165. Sort an Array

EasySorting

Sort the array in non-decreasing order. Try implementing a sort yourself (merge sort, quick sort or heap sort).

Input format

Line 1: n Line 2: n integers

Output format

The sorted array.

Example 1

Input

5
5 2 3 1 4

Output

1 2 3 4 5

Example 2

Input

1
0

Output

0

Constraints

1 ≤ n ≤ 10⁵

Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.

Loading the MyLoginn IDE…