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


char b[100][100];

void drawCircle(int n, int cx, int cy, int r) {
	int diff = 3 * r / 4;
	for (int x = 0; x < n; x++) {
		for (int y = 0; y < n; y++) {
			if (abs((x - cx) * (x - cx) + (y - cy) * (y - cy) - r * r) <= diff) {
				b[x][y] = 'B';
			}	
		}
	}
}

int main(int argc, char *argv[]) {
	assert(argc > 1);
	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';
		}
	}

	for (int r = 3; r <= n / 2; r += 2) {
		drawCircle(n, n / 2, n / 2, r);
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			int cur = b[i][j] == 'B';
			int chess = (i ^ j) & 1;
			b[i][j] = (cur ^ chess) ? 'B' : 'W';
		}
	}

	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;
}
