#C14978. Unique Sorted Elements

    ID: 44686 Type: Default 1000ms 256MiB

Unique Sorted Elements

Unique Sorted Elements

You are given a list of integers. Your task is to remove all duplicate elements and then sort the remaining unique numbers in ascending order.

For example, given the list [3, 1, 2, 3, 4, 1, 2], the unique sorted list is [1, 2, 3, 4].

In mathematical terms, if the input list is represented as \(L = [a_1, a_2, \dots, a_n]\), you need to compute the set \(S = \{a_1, a_2, \dots, a_n\}\) and then output the sorted sequence of elements of \(S\) in increasing order.

inputFormat

The input is read from standard input (stdin) and consists of two lines:

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

outputFormat

Output a single line to standard output (stdout) containing the unique sorted integers in ascending order, separated by a single space.

## sample
7
3 1 2 3 4 1 2
1 2 3 4