#K58717. Max Lexicographical Array

    ID: 30705 Type: Default 1000ms 256MiB

Max Lexicographical Array

Max Lexicographical Array

You are given an array of integers. Your task is to rearrange the elements of this array in descending order so that the resulting array is the lexicographically maximum possible permutation.

Input: The first line contains an integer n which represents the number of elements in the array. The second line contains n space-separated integers.

Output: Output the array sorted in descending order as a single line of space-separated integers.

Example:

Input:
6
1 0 2 1 0 2

Output: 2 2 1 1 0 0

</p>

It is guaranteed that the input will always follow the described format.

inputFormat

The first line of input contains an integer n (the number of elements in the array). The second line contains n space-separated integers.

outputFormat

Output the lexicographically maximum array (i.e., the array sorted in descending order) as a single line of space-separated integers.## sample

6
1 0 2 1 0 2
2 2 1 1 0 0