#C4827. Remove Duplicates and Sort

    ID: 48408 Type: Default 1000ms 256MiB

Remove Duplicates and Sort

Remove Duplicates and Sort

You are given a list of integers. Your task is to remove all the duplicate numbers from the list and then sort the unique numbers in non-descending order.

The input is given in two lines: the first line contains an integer \(n\) indicating the number of integers, and the second line contains \(n\) space-separated integers. The output should be the unique numbers sorted in non-decreasing order, printed as a space-separated string.

For example, if the input is:

5
4 5 6 6 4

Then, the output should be:

4 5 6

inputFormat

The input will be read from stdin and will consist of two lines:

  • The first line contains an integer \(n\) representing the number of elements in the list.
  • The second line contains \(n\) space-separated integers.

outputFormat

Output the unique sorted integers as a space-separated string to stdout.

## sample
5
4 5 6 6 4
4 5 6