Sequence

No attempts yetTime limit1sMemory limit128 MB

Problem

We call a sequence of numbers an arithmetic sequence in base bb if, when each number is read as a base-bb numeral, consecutive terms differ by a constant.

For example, 1,1010,2012,100211, 1010, 2012, 10021 is an arithmetic sequence in base 33, and 11,33,5511, 33, 55 is an arithmetic sequence not only in base 1010 but also in base 66.

Given a sequence of numbers, find the smallest base (at most 1010) in which the numbers form an arithmetic sequence.

If the largest digit appearing in any number is dd, then the base must be at least d+1d+1 for every digit to be valid, and it is always at least 22.

Input

The input consists of several test cases.

The first line of each test case contains an integer nn (2n52 \le n \le 5), the count of numbers in the sequence. The next line contains the nn numbers in strictly increasing order, separated by single spaces.

A line containing n=0n = 0 terminates the input. Every number is positive, uses only the digits 00 through 99, and has at most 55 digits.

Output

For each test case, print a single line.

If such a base exists, print

Minimum base = x.

where xx is the smallest base 10\le 10 that yields an arithmetic sequence. Otherwise, print

No base <= 10 can be found.