#C7681. Remove Duplicates from List

    ID: 51579 Type: Default 1000ms 256MiB

Remove Duplicates from List

Remove Duplicates from List

You are given a list of integers. Your task is to remove all duplicate elements, keeping only the first occurrence of each number, and output the resulting list in the same order as they first appear.

For example, given the input:

9
1 2 2 3 4 3 5 6 6

The output should be:

1 2 3 4 5 6

This can be formally expressed as: $$\text{output} = \{a_i \mid a_i \text{ is the first occurrence in the list}\}$$

inputFormat

The first line of input contains an integer \(n\) representing the number of elements in the list.

The second line contains \(n\) space-separated integers.

outputFormat

Output the list after removing duplicates, with the resulting numbers separated by a single space.

## sample
9
1 2 2 3 4 3 5 6 6
1 2 3 4 5 6