#P348. 练60.2 众数

练60.2 众数

Description

For a sequence {ana_n} of length nn, its mode is defined as the number that appears most frequently.
Given a sequence of length nn, please help find its mode.
Note that there may be multiple modes, you only need to output the smallest one.

Input Format

The first line contains nn, and the second line contains nn numbers, where n<106n<10^6 and 0ai10000≤a_i≤1000.

Output Format

Output the mode.

Sample

6
3 5 7 5 3 1
3