#P57. [KBC005A] Aircraft

[KBC005A] Aircraft

Source

This problem is adapted from Long Long OJ. All rights reserved.

Problem Description

One day, the State of hjj dispatched nn aircraft to the State of lzh. However, the State of lzh has a laser cannon that can destroy all aircraft with a height not exceeding xx (where xx is the height setting of the laser cannon) in one shot. Given the heights of the nn aircraft, find the minimum height xx for the laser cannon to destroy all nn aircraft in one shot.

Input Format

Two lines.

The first line contains a positive integer nn.

The second line contains nn positive integers a1ana_1 \sim a_n.

Output Format

A single line containing a positive integer, representing the minimum height xx of the laser cannon.

Samples

6
1 1 4 5 1 4
5

Data Range

1n1051\le n \le 10^5, 1ai1091\le a_i \le 10^9.