Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8824

Jo'natishlar soni: 714622

Muhokama yozuvlari: 4541

Yangiliklar soni: 98

Yangiliklar izohlari: 1177


So'ngi izohlar

725. Silver medal
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

Vasiliy athlete competed in hokkeybolu 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 the problem is not asked hokkeybola rules. You only need to determine how many points are scored Vasiliy. 

    Input

   The first line contains the number of athletes n (2  n  1000) participating in competitions. In the second line n integers are given - the results of competition. The numbers are in range from 1 to 109.

   Output

   Print one number - the result of Vasiliy.

Samples

Input

Output

1

5

4 3 3 1 2

3

2

8

1 2 5 3 5 6 6 5

5

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(92) Barcha urinishlar(159)