#C14956. Odd Occurrences Filter

    ID: 44662 Type: Default 1000ms 256MiB

Odd Occurrences Filter

Odd Occurrences Filter

Given an array of integers, your task is to find all the elements that occur an odd number of times. The resulting list must be sorted in ascending order.

Formally, let the input array be \( A = [a_1, a_2, \dots, a_n] \). For a given number \( x \) in \( A \), let \( f(x) \) denote the number of times \( x \) appears in \( A \). You must output all \( x \) such that \( f(x) \) is odd. The final list should be sorted in increasing order.

inputFormat

The input is read from standard input (stdin). The first line contains an integer \( n \), representing the number of elements in the array. The second line contains \( n \) space-separated integers.

outputFormat

Output the resulting array to standard output (stdout) as space-separated integers in ascending order. If no element occurs an odd number of times, output an empty line.

## sample
1
1
1

</p>