#include <iostream>
using namespace std;

long convert(long val, long base)
//
// return base 10 equivalent of <val>, assuming it's in base
// <base>.  If unable to do so, return 0.
//
{
	long r = 1;
	long ret = 0;
	while (val > 0) {
		long d = val%10;
		if (d >= base)
			return 0;
		ret += r*d;
		r *= base;
		val /= 10;
	}
	return ret;
}


bool good(long vals[], long n, long base)
//
// return true if values in <vals> is an arithmetic sequence in
// base <base>
//
{
	long a[5];
	for(long i=0; i<n; i++) {
		a[i] = convert(vals[i], base);
		if (a[i] == 0)		// vals[i] invalid in this base
			return false;
	}

	long diff = a[1] -a[0];
	for(i=2; i<n; i++)
		if (a[i] - a[i-1] != diff)
			return false;
	return true;
}

void main()
{
	long n;
	long vals[5];
	cin >> n;
	while (n != 0) {
		for(long i=0; i<n; i++)
			cin >> vals[i];
		long base = 2;
		while (base <= 10 && !good(vals, n, base))
			base++;
		if (base > 10)
			cout << "No base <= 10 can be found." << endl;
		else
			cout << "Minimum base = " << base << "." << endl;
		cin >> n;
	}
}

