All problems

The Runner-Up

mediumPythonNumPySorting

The Fenwick College bake-off hands out a runner-up rosette as well as a winner's. The rosette goes to whoever stands in second place on the score sheet, and places are counted by entries, not by different scores. So if two entries tie at the top, one of them takes first place and the other takes second, and the runner-up's score is then the same number as the winner's. There are always at least two entries.

Task: Print the score of the entry in second place.

Input

The first line holds a single integer n, the number of entries; n is at least 2. Each of the next n lines holds one score, which may carry decimals.

Output

One line holding the runner-up's score as a whole number, with no decimal point.

Example:

Input:
4
10
40
30
20

Output:
30

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…