An image-processing tool samples n pixel color codes (24-bit RGB integers, range 0 to 16777215) from an image. Find the color code that occurs the fewest times among the samples. If two or more codes tie for the fewest occurrences, output the largest such code.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, each in [0, 16777215].
Output format
A single integer: the least-frequent color code, with ties broken by the largest code value.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ each code ≤ 16777215