Step 8 of 12 · Sets
Keep unique values
Problem
Read a list of whole numbers and return each value only the first time it appears, preserving the original order.
Input
The first line contains n. The second line contains n space-separated integers.
Output
The unique values in their original order, separated by one space.
Examples
Input
7 4 2 4 3 2 3 9
Output
4 2 3 9
Only the first appearance of each value remains.