We call a sequence of numbers an arithmetic sequence in base b if, when each number is read as a base-b numeral, consecutive terms differ by a constant.
For example, 1,1010,2012,10021 is an arithmetic sequence in base 3, and 11,33,55 is an arithmetic sequence not only in base 10 but also in base 6.
Given a sequence of numbers, find the smallest base (at most 10) in which the numbers form an arithmetic sequence.
If the largest digit appearing in any number is d, then the base must be at least d+1 for every digit to be valid, and it is always at least 2.
The input consists of several test cases.
The first line of each test case contains an integer n (2≤n≤5), the count of numbers in the sequence. The next line contains the n numbers in strictly increasing order, separated by single spaces.
A line containing n=0 terminates the input. Every number is positive, uses only the digits 0 through 9, and has at most 5 digits.
For each test case, print a single line.
If such a base exists, print
Minimum base = x.
where x is the smallest base ≤10 that yields an arithmetic sequence. Otherwise, print
No base <= 10 can be found.