12432 - Find the Maximum Duplicate Number   

Description

Given a sequence containing integers where each integer is between 1 and 1000(exclusive), prove that at least one duplicate number must exist. Assume that there could be multiple duplicate numbers, find the maximum value of duplicate one.

Note : If you are using visual studio, add #pragma warning(disable:4996) in the first line so that you can use scanf on your local machine.

Input

N

S

N is an integer,  and 1<=N<10000.

S is a sequence. Each integer  in it is between 1 and 1000(exclusive).

 

Output

Maximum duplicate number.

Remember change line in the end.

Sample Input  Download

Sample Output  Download

Tags




Discuss