Find Two Numbers Appearing Once
Given an array where every element appears twice except two, find those two unique elements.
Input format
The first line contains N. The second line contains N integers where every value appears exactly twice except two distinct values that appear once.
Output format
Print the two values that appear once, in increasing order, separated by a space.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
6
1 2 1 3 2 5Expected output
3 5Example 2
Input
2
4 9Expected output
4 9