Passionate Sorting

Interview

Time limit1sMemory limit512 MB

Summary
Read N numbers and print them in ascending order separated by spaces.
Level

Easy1 of 10

Topics
Sorting, Implementation
Solved
No attempts yet

Problem

Hyeongjun has a sequence. He wants to sort this sequence passionately. Can he sort it?

Input

The first line gives the length of the sequence, NN (1 ≤ NN ≤ 500,000).

The second line gives each element aia_i of the sequence in order, separated by spaces. The absolute value of aia_i is at most 2 million.

Output

Sort the sequence aa in ascending order and print the elements one by one, separated by spaces.

Hint

Try googling the sorting function for your language~~

For example, in C++ you can sort the array arr with sort(arr, arr+n);, and in Python with arr.sort().

Examples1

  1. Example 1

    Input
    6
    14 5 8 7 1 10
    
    Expected output
    1 5 7 8 10 14