Competitions

# Ternary search

# Maximum in Unimodal Sequence

Sequence `a`

is called _{i}**unimodal** if there exists such index **p** that `a`

< _{1}`a`

< ... < _{2}`a`

and _{p}`a`

> _{p}`a`

> ... > _{p+1}`a`

. Value _{n}`a`

is maximum in this sequence. You must find this value._{p}

#### Input

First line contains the size of array **n** (**n** ≤ `10`

). Next line contains ^{6}**n** positive integers that represent a unimodal sequence. Numbers in array do not exceed `10`

.^{9}

#### Output

Print the maximum element is the unimodal sequence.

Input example #1

10 2 4 7 12 18 19 16 11 8 3

Output example #1

19

Input example #2

6 3 5 7 11 15 17

Output example #2

17