#K53247. Correct Positions

    ID: 29489 Type: Default 1000ms 256MiB

Correct Positions

Correct Positions

You are given an unsorted array of positive integers. Your task is to sort the array so that every element is in its correct position; i.e., the array is sorted in non-decreasing order. This can be mathematically expressed as:

a1a2ana_1 \le a_2 \le \dots \le a_n

In this context, you can think of each number as representing a student, and sorting the array places every student in their correct spot. This is a straightforward sorting problem that tests your ability to read, process, and output data from standard input and output.

inputFormat

The first line of the input contains an integer NN representing the number of elements in the array. The second line contains NN space-separated positive integers.

outputFormat

Output a single line containing the sorted array in non-decreasing order, with each element separated by a single space.## sample

6
4 2 3 6 5 1
1 2 3 4 5 6