#include "random.h"
#include <cstdio>
#include <cassert>

using namespace std;

int main(int argc,char** argv){
	assert(argc >= 4);
	int n,dlt;
	int seed = 0;
	if (argc >= 2)
		assert(sscanf(argv[1],"%d",&seed) == 1);
	if (seed == 0) {	
		seed = Time();
		fprintf(stderr,"Using seed : %d\n",seed);
	}
	initrand(seed);

	assert(sscanf(argv[2],"%d",&n) == 1);
	assert(sscanf(argv[3],"%d",&dlt) == 1);
	printf("%d\n",n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) 
			if (i < dlt || j < dlt || i >= n - dlt || j >= n - dlt)
				printf("%c", ((i ^ j) & 1) ? 'B' : 'W');
			else
				printf("%c", rndInt(2)?'W':'B');
		printf("\n");
	}
	return 0;
}