favorite We need a little bit of your help to keep things running, click on this banner to learn more

Loops - 2

Silver medal

Vasiliy athlete competed in hokkeybol and got in the individual event silver medal. It is known that participants who scored the same number of points will be awarded the same awards. We also know that were raffled off with gold, silver and bronze medals. In this problem we do not ask the hokkeybol rules. You only need to determine how many points were scored by Vasiliy.


The first line contains the number of athletes n (2n1000) participating in competitions. In the second line n integers are given - the results of competition.


Print one number - the result of Vasiliy.

Time limit 1 second
Memory limit 128 MiB
Input example #1
4 3 3 1 2 
Output example #1
Input example #2
1 2 5 3 5 6 6 5 
Output example #2
Source Stage II Ukrainian School Olympiad 2011-2012, Berdichev