Vasiliy competed in hokkeybol and won a silver medal in the individual event. It is known that participants who scored the same number of points will be awarded the same awards. It is also known that gold, silver, and bronze medals were awarded. The rules of hokkeybol are not important for this problem. You only need to determine how many points were scored by Vasiliy.
The first line contains the number of athletes (2 \le n \le 1000) participating in competitions. In the second line integers are given - the results of competition.
Print one integer - the result of Vasiliy.
Example 1