#include<bits/stdc++.h>
using namespace std;
char in[100], out[100];
int main(){
	for(int I=1;I<=20;I++){
		int n, a=0, b=0, i, j, k, d;
		if(I>10) n = 1000;
		else n = I;
		sprintf(in,".%d.in",I);
		freopen(in,"w",stdout);
		cout<<n<<"\n";
				
		for(i=0;i<n;i++){
			string s="";
			for(j=0;j<n;j++){
				d = rand()%2;
				char c;
				if(d==0) c = 'W';
				else c = 'B';
				s = s+c; 
				k = (i+j)%2;
				if((k==0 and c=='W') or (k==1 and c=='B')) a++;
				else b++; 
			}
			cout<<s<<"\n";
		}
		sprintf(in,".%d.out",I);
		freopen(in,"w",stdout);
		if(a>b) cout << n*n - a;
		else cout << n*n - b;
	}
}

