#C2365. Unique Robot IDs

    ID: 45673 Type: Default 1000ms 256MiB

Unique Robot IDs

Unique Robot IDs

You are given several test cases. Each test case begins with a positive integer n, representing the number of robot IDs, followed by a line containing n space-separated integers. Your task is to print the unique robot IDs in ascending order for each test case.

The process terminates when a test case with n = 0 is encountered.

Note: The unique IDs should be printed in non-decreasing order, separated by a single space.

In mathematical terms, for each test case you are given a sequence \(a_1, a_2, \dots, a_n\). You must compute the set \(\{a_1, a_2, \dots, a_n\}\) and output the elements sorted in ascending order.

inputFormat

The input consists of several test cases. Each test case is given as follows:

  • The first line contains an integer n (\(1 \leq n \leq 10^5\)), the number of robot IDs.
  • The second line contains n space-separated integers.

The input terminates with a test case where n = 0, which should not be processed.

outputFormat

For each test case, output a single line containing the unique robot IDs in ascending order, separated by a single space.

## sample
5
4 7 4 2 7
6
3 3 1 6 1 5
0
2 4 7

1 3 5 6

</p>