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.
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}).
Output a single line with the number that satisfies the problem's conditions.
Ejemplo 1