A toll plaza records the lane id used by each passing vehicle. Determine which lane id was used most often. If two or more lane ids are tied for the highest count, report the smallest such id.
Input format
Line 1: an integer n, the number of vehicles.
Line 2: n space-separated integers, the lane id used by each vehicle.
Output format
A single integer: the most-used lane id, breaking ties toward the smallest id.
Constraints
- 1 <= n <= 40
- 1 <= each lane id <= 1000000