P13071 [HackerEarth] lord vaders death star 2
普及
题目描述

Darth Vader, the lord of the dark side has created a Death-Star (it can destroy any star). You have to deactivate the Death-star. To deactivate the death-star one must find the unique most powerful Lightsaber. Lightsaber’s power is associated with a number. You ask for Lightsaber from your friendly Jedis(person). You should choose the Lightsaber which has the unique power as well as it is powerful enough.

Input:::
First line of input contains N,denoting the number of Lightsabers. Next line contains N space separated numbers denoting the power(Ai) of each Lightsaber.

Output :::
Print power of the unique most powerful Lightsaber.If there is no such lightsaber present then print -1.

Constraints:::
1 ≤ N ≤ 10^6,
0 ≤ Ai ≤ 10^9.

SAMPLE INPUT
5
9 8 8 9 5

SAMPLE OUTPUT
5

输入格式

见题面

输出格式

见题面

样例输入
5 9 8 8 9 5 SAMPLE
样例输出
5