The most agile#5891

The most agile

2 segundos
64 megabytes
Fácil

When numbers are sorted lexicographically, their order may differ from their order by numerical value. For instance, while is less than numerically, lexicographically comes before . This is because lexicographic comparison treats numbers as strings, comparing them character by character from left to right.

Given integers, identify the number that has the greatest difference in position between these two types of orderings. If there is a tie, choose the smaller number.

Entrada

The first line contains the integer , followed by integers on the next line (1 \le N \le 250000, with absolute values not exceeding 10^{18}).

Salida

Output a single line with the number that satisfies the problem's conditions.

Ejemplos

Ejemplo 1

Loading
Loading