#include "testlib.h"

using namespace std;

const int MAXN = 100;

string inp[MAXN];

int group;

int main(int argc,char** argv){
	registerValidation();

	if (argc == 1)
		group = 0;
	else {
		ensure(sscanf(argv[1],"%d",&group) == 1);
		if (!(group == 1 || group == 2 || group == 0))
			quitf(_fail,"What is group %d?",group);
	}

	int n = inf.readInt(1,MAXN,"n");
	if (group == 1){
		if (!(5 <= n && n <= 25))
			quitf(_fail, "N = %d (wrong group)",n);
	}
	if (group == 2){
		if (!(60 <= n && n <= 100))
			quitf(_fail, "N = %d (wrong group)",n);
	}
	inf.readEoln();
	for (int i = 0; i < n; i++){
		inp[i] = inf.readToken("[BW]{"+vtos(n)+"}");
		inf.readEoln();
	}
	inf.readInt(0,20);
	inf.readEoln();
	inf.readEof();

	bool chess = 1;

	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			if ( (i % 2 == 0) ^ (j % 2 == 0) ^ (inp[i][j] != inp[0][0]))
				chess = 0;

	if (chess)
		quitf(_fail,"It's a chess board!");
	return 0;
}