Each serial number consists of
single numbers
.
Valid serial numbers satisfy
with
. The
is specific to and only known by the
cloister that has transcribed this book and is therefore able to check its origin.
You are confronted with a pile of books that presumably have been transcribed by a single cloister. You are asked to write a computer program to determine that cloister, i.e. to calculate the biggest possible that makes the serial numbers of these books valid. Obviously, no cloister has chosen . So if your calculations yield , there must be something wrong.
Input
Input starts with an integer
on a single line, the number of test cases (
). Each test case starts with an integer
on a single line,
the number of serial numbers you have to consider (
).
Each of the following
lines holds
integer numbers
(
) separated by single spaces.
Output
For each test case, output a single line containing the largest possible
, so
that each given serial number for that test case is valid. If you cannot find a
satisfying the condition for all serial numbers or if the numbers are
valid independent of the choice of
, output ``impossible'' (without
the quotes) on a single line.
Sample Input
Sample Output