An environmental sensor emits n integer byte readings (each between 0 and 255 inclusive) during a monitoring window. The dashboard needs to display the dominant reading — the value that occurs most often.
If two or more values are tied for the highest frequency, the dashboard always shows the smallest of the tied values (this is the platform's official tie-break rule).
Input format
Line 1: an integer n.
Line 2: n space-separated integers, each in [0, 255].
Output format
A single integer: the most frequent value, with ties broken by choosing the smallest value.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ each value ≤ 255