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

~/algor $ cat problems/bit-ikki-juftsiz

Two unpaired numbers

Medium 1000 ms 128 MB 47%
Share

An array of $n$ integers is given. Two different numbers in it occur once each, and every other number occurs exactly twice. Print the two numbers that occur once, in increasing order.

Array cells; paired numbers share a colour, the two single ones are highlighted

Input

The first line contains an even positive integer $n$. The second line contains $n$ integers $a_{i}$.

Output

Two numbers separated by a space — in increasing order.

Note

$2 \le n \le 2 \cdot 10^{5}$
$0 \le a_{i} \le 10^{9}$

Examples

Input #1
6
4 7 9 4 2 9
Output #1
2 7
Input #2
2
0 1000000000
Output #2
0 1000000000

Sign in to submit a solution

Signing up is free and takes a minute.