#include "random.h"

using namespace std;

const int MAXN = 100;

int a[MAXN];

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

	printf("%d\n",n);

	for (int i = 0; i < n; i++)
		a[i] = R(1,n);

	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++)
			if (i < a[j])
				printf("B");
			else
				printf("W");
		printf("\n");
	}

	return 0;

}