A vault inventory scans a pile of tags. Every distinct tag value was scanned exactly three times, except for a single lone tag that was scanned exactly once. Given all the scanned values in arbitrary order, identify the value of the lone tag.
Input format
Line 1: an integer n, the number of scans (n is congruent to 1 modulo 3).
Line 2: n space-separated non-negative integers, the scanned values.
Output format
A single integer: the value that appears exactly once.
Constraints
- 1 <= n <= 100000, with n mod 3 == 1
- 0 <= each value <= 1000000000
- Exactly one value appears once; every other distinct value appears exactly three times.