#C5960. Remove Duplicates in Registration Numbers

    ID: 49667 Type: Default 1000ms 256MiB

Remove Duplicates in Registration Numbers

Remove Duplicates in Registration Numbers

You are given a list of registration numbers. Your task is to remove all duplicate numbers while preserving the order of their first occurrence.

The input begins with an integer n representing the number of registration numbers. The next line contains n integers separated by spaces. The output should be the registration numbers with duplicates removed, separated by a single space.

Mathematically, if the input sequence is \(a_1, a_2, \dots, a_n\), then you need to output a sequence \(b_1, b_2, \dots, b_k\) such that:

\[ \{b_1, b_2,\dots, b_k\} \subseteq \{a_1, a_2,\dots, a_n\} \]

and for every \(b_i\) (\(1 \leq i \leq k\)), \(b_i\) is the first occurrence of that number in the input sequence.

inputFormat

The first line of input contains an integer n (\(0 \leq n \leq 10^5\)) representing the number of registration numbers. The second line contains n space-separated integers.

outputFormat

Print the registration numbers after removing the duplicates, preserving the original order. The numbers should be separated by a single space. If the list is empty, produce no output.

## sample
8
10 22 10 33 22 44 55 10
10 22 33 44 55