CCSC Mid-South Programming Contest

#### Start

2018-04-06 10:00 AKDT

## CCSC Mid-South Programming Contest

#### End

2018-04-06 14:00 AKDT
The end is near!
Contest is over.
Not yet started.
Contest is starting in -1259 days 8:55:52

4:00:00

0:00:00

# Problem EPenultimate Ice Cream

Public Domain (CC0)

Sara is at her favorite ice cream store. She would really like to get the most expensive item on the menu (because it will contain the most ice cream, of course). However, if her friends notice that she bought the most expensive item on the menu, they will assume she has plenty of money and start bugging her to buy ice cream for them too. So she decides to settle for the second most expensive item on the menu, which will still contain plenty of ice cream but will not attract the attention of her friends.

## Input

The first line of the input is an integer $n$, with $2 \leq n \leq 1\, 000$. The second line contains $n$ space-separated integers, which are the prices of items on the menu. Each price is between $1$ and $1\, 000$, inclusive. All the prices will be distinct.

## Output

Output a single line containing the price of the second most expensive item on the menu.

Sample Input 1 Sample Output 1
10
4 8 2 1 6 9 22 13 18 5

18