#C13702. Unique Elements Extraction

    ID: 43270 Type: Default 1000ms 256MiB

Unique Elements Extraction

Unique Elements Extraction

You are given a list of integers. Your task is to extract the elements that appear exactly once in the list and output them in the same order as they appear in the input.

More formally, let \(A = [a_1, a_2, \dots, a_n]\) be the input list. You need to output a list \(B\) such that for every element \(x\) in \(B\), the count of \(x\) in \(A\) is exactly one, and the relative order of the elements is preserved.

If there are no unique elements, output an empty line.

inputFormat

The input is given via standard input (stdin). It consists of two lines:

  • The first line contains an integer \(n\) — the number of elements in the list.
  • The second line contains \(n\) space-separated integers.

outputFormat

Output the unique integers (elements that appear exactly once) in the same order as in the input, separated by a single space on one line. If there are no unique elements, output an empty line.

## sample
5
1 2 3 4 5
1 2 3 4 5

</p>