Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-takrorlarni-ochirish

Removing duplicates

Easy 1000 ms 64 MB 28%
Share

An array of $n$ integers is given. Keep every value only at the place of its first occurrence, remove the repeats and print the resulting array. The order of the elements does not change.

The array in cells; repeated values are crossed out, the rest are copied to a new row

Input

The first line contains a positive integer $n$.
The second line contains $n$ integers — the elements of the array.

Output

Numbers separated by spaces — the array without duplicates.

Note

$1 \le n \le 1000$
the elements are from $-1000$ to $1000$

Examples

Input #1
8
3 1 3 2 1 5 2 3
Output #1
3 1 2 5
Input #2
4
7 7 7 7
Output #2
7

Sign in to submit a solution

Signing up is free and takes a minute.