#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 n (1n105)n\ (1 \le n \le 10^5).

The second line contains nn positive integers a1,a2,,an (1ai109)a_1, a_2, \ldots, a_n\ (1 \le a_i \le 10^9).

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