Write a program that takes input of an integer N, followed by N integers. The program then outputs the number closest to the average of those N integers. If there are more than one solution, output the one that comes first in the input list.?

Your output lines should not have any trailing or leading whitespaces In case of error your output should be 0

Input

5 1 2 3 4 6

Output

3

Explanation:

The average is 3.20 for {1,2,3,4,6}. Hence 3 is the closest