#include <cstdio>
#include <cmath>
#include <cassert>
using namespace std;


char b[100][100];

int main(int argc, char *argv[]) {
	assert(argc == 2);
	int n;
	assert(sscanf(argv[1], "%d", &n) == 1);

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			b[i][j] = 'W';
		}
	}

	int cx = n / 2;
	int cy = n / 2;
	int r = n / 4;

	for (int x = 0; x < n; x++) {
		for (int y = 0; y < n; y++) {
			if ((x - cx) * (x - cx) + (y - cy) * (y - cy) <= r * r) {
				b[x][y] = 'B';
			}
		}
	}

	for (int x = 0; x < n; x++) {
		b[x][cy] = 'B';
	}

	for (int y = 0; y < n; y++) {
		b[cx][y] = 'B';
	}

	printf("%d\n", n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			putchar(b[i][j]);
		}
		putchar('\n');
	}
	return 0;
}
