Sorting an array in ascending order

C++ Easy sorting

Task «Sorting an array in ascending order»

Given an array of integers. Sort it in ascending order using any sorting algorithm. Output the sorted array.

Input Format

The first line contains an integer N (1 ≤ N ≤ 1000) — the number of elements. The second line contains N integers separated by spaces.

Output Format

Output N integers separated by spaces — the array sorted in ascending order.

Examples

Example 1

INPUT
5 3 1 4 1 5
OUTPUT
1 1 3 4 5

Example 2

INPUT
1 10
OUTPUT
10

Example 3

INPUT
3 100 50 75
OUTPUT
50 75 100

Example 4

INPUT
2 2
OUTPUT
2

Example 5

INPUT
1 42
OUTPUT
42
main.cpp