L. Nanami, Nanami, Nanami...
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Finally, Nanami leaves you a note that says:

Here's the last question: Given a sequence $$$a$$$ of length greater than or equal to $$$2$$$, you must remove an integer $$$c$$$ from the sequence and get an integer $$$d$$$ strictly less than $$$c$$$ that already exists in the sequence, what is the maximum value of the integer $$$d$$$ that you can get?

Input

In the first line, an integer $$$t(1\le t \le 100)$$$, representing the number of data sets.

For each data group:

The first line, an integer $$$n(2\le n \le 100)$$$, represents the length of the sequence.

The second line, $$$n$$$ integers $$$a_1,\dots,a_n(1\le a_i \le 100)$$$, represents the sequence $$$a$$$.

It is guaranteed that for each sequence, there must exist two subscripts $$$i,j$$$ satisfying $$$i\neq j$$$ and $$$a_i\neq a_j$$$.

Output

For each set of data, output a line of integers representing the maximum value you can get for the integer $$$d$$$.

Example
Input
5
2
1 2
3
1 2 3
3
1 4 2
5
1 2 9 4 3
7
5 2 1 1 3 1 4
Output
1
2
2
4
4