#define _CRT_SECURE_NO_DEPRECATE
#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <sstream>
#include <iomanip>
#include <random>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <numeric>
#include <cstring>
#include <complex>
#include <cassert>
#include <iterator>
#include <functional>
typedef long long int64;
typedef long double ld;

const int inf = (int)2e+9 + 2;
const int64 mod = (int64)1e+9 + 7;
const int h_prime = 1103;
const double eps = 1e-6;
//const int maxn = 1e+6;

#define pb push_back
using namespace std;
typedef pair<ld, ld> vec;
typedef vector <int64> vint;
typedef vector <vint> vvint;
vint primes;
vint HH, pp;

ld dist(vec a, vec b)
{
	return sqrtl((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
}
ld len(vec x)
{
	return sqrtl(x.first * x.first + x.second * x.second);
}
ld angle(vec a, vec b)
{
	return acos((a.first * b.first + a.second * b.second) / (len(a) * len(b)));
}
ld ar_tr(vec a, vec b)
{
	return a.first * b.second - b.first * a.second;
}

int64 get_hash(int l, int r)
{
	int64 res = HH[r];
	if (l)
		res -= HH[l - 1] * pp[r - l + 1];
	return res;
}

void init_hashes(string s)
{
	int64 hash = s[0];
	HH.pb(hash);
	int64 ppow = 1;
	for (size_t i = 0; i < s.length(); ++i)
	{
		pp.pb(ppow);
		ppow *= h_prime;
	}
	for (size_t i = 1; i < s.length(); ++i)
	{
		hash *= h_prime;
		hash += s[i];
		HH.pb(hash);
	}
}

inline int64 gcd(int64 x, int64 y)
{
	while (y)
	{
		x %= y;
		swap(x, y);
	}
	return x;
}
void init_primes(int64 maxn)
{
	vector <bool> np(maxn, false);
	np[0] = np[1] = true;
	for (int i = 2; i * i < maxn; ++i)
		if (!np[i])
		{
			for (int j = i * i; j < maxn; j += i)
				np[j] = true;
			primes.pb(i);
		}
}
int64 binpow(int64 a, int64 b)
{
	int64 res = 1;
	while (b)
	{
		if (b & 1)
			res *= a;
		a *= a;
		b /= 2;
	}
	return res;
}
#ifdef TREE
vector<int64> tree, nval;

void push(int v, int l, int r) {
	if (nval[v] != -1) {
		if (l != r) {
			nval[2 * v + 1] = nval[v];
			nval[2 * v + 2] = nval[v];
		}
		tree[v] = nval[v] * (r - l + 1);
		nval[v] = -1;
	}
}

int64 get(int v, int l, int r, int ml, int mr) {
	push(v, l, r);
	if (r < ml || mr < l)return 0;
	if (ml <= l && r <= mr)return tree[v];
	int mid = l + (r - l) / 2;
	int64 tree1 = get(2 * v + 1, l, mid, ml, mr);
	int64 tree2 = get(2 * v + 2, mid + 1, r, ml, mr);
	return tree1 + tree2;
}

void update(int v, int l, int r, int ml, int mr, int64 val) {
	push(v, l, r);
	if (r < ml || mr < l)return;
	if (ml <= l && r <= mr) {
		nval[v] = val;
		push(v, l, r);
		return;
	}
	int mid = l + (r - l) / 2;
	update(2 * v + 1, l, mid, ml, mr, val);
	update(2 * v + 2, mid + 1, r, ml, mr, val);
	tree[v] = tree[2 * v + 1] + tree[2 * v + 2];
}
#endif
int64 fib(int64 n, int64 m) {
	int64 result;
	int64 index;
	int64 period = n + 1;
	int64 sz = min(n + 1, m * m + 1); // Bound for period
	int64* F = new int64[sz];
	F[0] = 0;
	F[1] = 1;
	F[2] = 1;

	for (int64 i = 3; i < sz; i++) {
		F[i] = (F[i - 2] + F[i - 1]) % m;
		if (F[i] == 1 && F[i - 1] == 0) { // we have got back to where we started
			period = i - 1;
			break;
		}
	}

	index = n % period;
	result = F[index];
	delete[]F;
	return result;

}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	string s;
	cin >> s;
	for (int i = 0; i < s.size(); ++i)
		if (s[i] == 'm' || s[i] == 'w')
		{
			cout << 0;
			return 0;
		}
	vint us;
	int u = 0;
	int n = 0;
	for (int i = 0; i < s.size(); ++i)
	{
		if (s[i] == 'n')
		{
			n++;
			continue;
		}
		if (s[i] == 'u')
		{
			u++;
			continue;
		}
		if (u != 0)
		{
			us.pb(u);
			u = 0;
		}
		if (n != 0)
		{
			us.pb(n);
			n = 0;
		}
	}
	if (u != 0)
	{
		us.pb(u);
		u = 0;
	}
	if (n != 0)
	{
		us.pb(n);
		n = 0;
	}
	int64 ans = 1;
	for (int i = 0; i < us.size(); ++i)
	{
		ans *= fib(us[i]+1, mod);
		ans %= mod;
	}
	cout << ans;
}


#define _CRT_SECURE_NO_DEPRECATE
#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <sstream>
#include <iomanip>
#include <random>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <numeric>
#include <cstring>
#include <complex>
#include <cassert>
#include <iterator>
#include <functional>
typedef long long int64;
typedef long double ld;

const int inf = (int)2e+9 + 2;
const int64 mod = (int64)1e+9 + 7;
const int h_prime = 1103;
const double eps = 1e-6;
//const int maxn = 1e+6;

#define pb push_back
using namespace std;
typedef pair<ld, ld> vec;
typedef vector <int64> vint;
typedef vector <vint> vvint;
vint primes;
vint HH, pp;

ld dist(vec a, vec b)
{
	return sqrtl((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
}
ld len(vec x)
{
	return sqrtl(x.first * x.first + x.second * x.second);
}
ld angle(vec a, vec b)
{
	return acos((a.first * b.first + a.second * b.second) / (len(a) * len(b)));
}
ld ar_tr(vec a, vec b)
{
	return a.first * b.second - b.first * a.second;
}

int64 get_hash(int l, int r)
{
	int64 res = HH[r];
	if (l)
		res -= HH[l - 1] * pp[r - l + 1];
	return res;
}

void init_hashes(string s)
{
	int64 hash = s[0];
	HH.pb(hash);
	int64 ppow = 1;
	for (size_t i = 0; i < s.length(); ++i)
	{
		pp.pb(ppow);
		ppow *= h_prime;
	}
	for (size_t i = 1; i < s.length(); ++i)
	{
		hash *= h_prime;
		hash += s[i];
		HH.pb(hash);
	}
}

inline int64 gcd(int64 x, int64 y)
{
	while (y)
	{
		x %= y;
		swap(x, y);
	}
	return x;
}
void init_primes(int64 maxn)
{
	vector <bool> np(maxn, false);
	np[0] = np[1] = true;
	for (int i = 2; i * i < maxn; ++i)
		if (!np[i])
		{
			for (int j = i * i; j < maxn; j += i)
				np[j] = true;
			primes.pb(i);
		}
}
int64 binpow(int64 a, int64 b)
{
	int64 res = 1;
	while (b)
	{
		if (b & 1)
			res *= a;
		a *= a;
		b /= 2;
	}
	return res;
}
#ifdef TREE
vector<int64> tree, nval;

void push(int v, int l, int r) {
	if (nval[v] != -1) {
		if (l != r) {
			nval[2 * v + 1] = nval[v];
			nval[2 * v + 2] = nval[v];
		}
		tree[v] = nval[v] * (r - l + 1);
		nval[v] = -1;
	}
}

int64 get(int v, int l, int r, int ml, int mr) {
	push(v, l, r);
	if (r < ml || mr < l)return 0;
	if (ml <= l && r <= mr)return tree[v];
	int mid = l + (r - l) / 2;
	int64 tree1 = get(2 * v + 1, l, mid, ml, mr);
	int64 tree2 = get(2 * v + 2, mid + 1, r, ml, mr);
	return tree1 + tree2;
}

void update(int v, int l, int r, int ml, int mr, int64 val) {
	push(v, l, r);
	if (r < ml || mr < l)return;
	if (ml <= l && r <= mr) {
		nval[v] = val;
		push(v, l, r);
		return;
	}
	int mid = l + (r - l) / 2;
	update(2 * v + 1, l, mid, ml, mr, val);
	update(2 * v + 2, mid + 1, r, ml, mr, val);
	tree[v] = tree[2 * v + 1] + tree[2 * v + 2];
}
#endif
int64 fib(int64 n, int64 m) {
	int64 result;
	int64 index;
	int64 period = n + 1;
	int64 sz = min(n + 1, m * m + 1); // Bound for period
	int64* F = new int64[sz];
	F[0] = 0;
	F[1] = 1;
	F[2] = 1;

	for (int64 i = 3; i < sz; i++) {
		F[i] = (F[i - 2] + F[i - 1]) % m;
		if (F[i] == 1 && F[i - 1] == 0) { // we have got back to where we started
			period = i - 1;
			break;
		}
	}

	index = n % period;
	result = F[index];
	delete[]F;
	return result;

}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	string s;
	cin >> s;
	for (int i = 0; i < s.size(); ++i)
		if (s[i] == 'm' || s[i] == 'w')
		{
			cout << 0;
			return 0;
		}
	vint us;
	int u = 0;
	int n = 0;
	for (int i = 0; i < s.size(); ++i)
	{
		if (s[i] == 'n')
		{
			if (u != 0)
			{
				us.pb(u);
				u = 0;
			}
			n++;
			continue;
		}
		if (s[i] == 'u')
		{
			if (n != 0)
			{
				us.pb(n);
				n = 0;
			}
			u++;
			continue;
		}
		if (u != 0)
		{
			us.pb(u);
			u = 0;
		}
		if (n != 0)
		{
			us.pb(n);
			n = 0;
		}
	}
	if (u != 0)
	{
		us.pb(u);
		u = 0;
	}
	if (n != 0)
	{
		us.pb(n);
		n = 0;
	}
	int64 ans = 1;
	for (int i = 0; i < us.size(); ++i)
	{
		ans *= fib(us[i]+1, mod);
		ans %= mod;
	}
	cout << ans;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <functional>
#include <ctime>
#include <iomanip>
#include <sstream>
#include <algorithm>
#define ll long long
#define mes(x,y) memset(x,y,sizeof(x))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll GCD(ll a, ll b) {//最大公约数
	return b == 0 ? a : GCD(b, a % b);
}
const ll maxn = 1e9 + 7;
ll _power(ll a, ll b, ll p) { //计算(a^b)%p;
	ll ans = 1;
	while (b) {
		if (b & 1) //等价于b%2，判断b的奇偶性
			ans = ans * a % p; //如果为奇数，证明该位为1，需要乘上a
		a = a * a % p; //计算a^(2^i)
		b >>= 1; //等价于b/=2;
	}
	return ans;
}

int main() {
	ll n, m, i, j;
	string s;
	ll a[100050];
	a[1] = 1;
	a[2] = 2;
	for (i = 3; i <= 100020; i++) {
		a[i] = a[i - 1] + a[i - 2];
	}
	while (cin >> s) {
		bool flag = false;
		ll sum = 0;
		vector<ll>v; v.clear();
		for (i = 0, j = s.length(); i < j; i++) {
			if (s[i] == 'm' || s[i] == 'w') {
				flag = true;
				break;
			}
			if (s[i] == 'n'||s[i]=='u') {
				ll l=1;
				while (s[i] == s[i + 1]) {
					i++; l++;
				}
				v.push_back(a[l]);
			}
		}
		if (flag) {
			sum = 0;
			cout << sum << endl;
			continue;
		}
		if (v.size() > 0) {
			sum = v[0];
			for (i = 1, j = v.size(); i < j; i++) {
				sum *= v[i];
				sum %= maxn;
			}
		}
		cout << sum << endl;
	}
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <functional>
#include <ctime>
#include <iomanip>
#include <sstream>
#include <algorithm>
#define ll long long
#define mes(x,y) memset(x,y,sizeof(x))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll GCD(ll a, ll b) {//最大公约数
	return b == 0 ? a : GCD(b, a % b);
}
const ll maxn = 1e9 + 7;
ll _power(ll a, ll b, ll p) { //计算(a^b)%p;
	ll ans = 1;
	while (b) {
		if (b & 1) //等价于b%2，判断b的奇偶性
			ans = ans * a % p; //如果为奇数，证明该位为1，需要乘上a
		a = a * a % p; //计算a^(2^i)
		b >>= 1; //等价于b/=2;
	}
	return ans;
}

int main() {
	ll n, m, i, j;
	string s;
	ll a[100050];
	mes(a, 0);
	a[1] = 1;
	a[2] = 2;
	for (i = 3; i <= 100020; i++) {
		a[i] = (a[i - 1] + a[i - 2])%maxn;
	}
	while (cin >> s) {
		bool flag = false;
		ll sum = 0;
		vector<ll>v; v.clear();
		for (i = 0, j = s.length(); i < j; i++) {
			if (s[i] == 'm' || s[i] == 'w') {
				flag = true;
				break;
			}
			if (s[i] == 'n'||s[i]=='u') {
				ll l=1;
				while (s[i] == s[i + 1]) {
					i++; l++;
				}
				v.push_back(a[l]);
			}
		}
		if (flag) {
			sum = 0;
			cout << sum << endl;
			continue;
		}
		if (v.size() > 0) {
			sum = v[0];
			for (i = 1, j = v.size(); i < j; i++) {
				sum = sum*v[i]%maxn;
			}
		}
		cout << sum << endl;
	}
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <functional>
#include <ctime>
#include <iomanip>
#include <sstream>
#include <algorithm>
#define ll long long
#define mes(x,y) memset(x,y,sizeof(x))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll GCD(ll a, ll b) {//最大公约数
	return b == 0 ? a : GCD(b, a % b);
}
const ll maxn = 1e9 + 7;
ll _power(ll a, ll b, ll p) { //计算(a^b)%p;
	ll ans = 1;
	while (b) {
		if (b & 1) //等价于b%2，判断b的奇偶性
			ans = ans * a % p; //如果为奇数，证明该位为1，需要乘上a
		a = a * a % p; //计算a^(2^i)
		b >>= 1; //等价于b/=2;
	}
	return ans;
}

int main() {
	ll n, m, i, j;
	string s;
	ll a[100050];
	mes(a, 0);
	a[1] = 1;
	a[2] = 2;
	for (i = 3; i <= 100020; i++) {
		a[i] = (a[i - 1] + a[i - 2]) % maxn;
	}
	while (cin >> s) {
		bool flag = false;
		ll sum = 1;
		for (i = 0, j = s.length(); i < j; i++) {
			if (s[i] == 'm' || s[i] == 'w') {
				flag = true;
				break;
			}
			if (s[i] == 'n'||s[i]=='u') {
				ll l=1;
				while (s[i] == s[i + 1]&&i+1<j) {
					i++; l++;
				}
				sum = sum * a[l] % maxn;
			}
		}
		if (flag) {
			sum = 0;
		}
		cout << sum << endl;
	}
}


for i in range(int(raw_input())):
	n,m = map(int,raw_input().split())

	print 'W' + "B"*(m-1)

	for i in range(n-1):
		print "B"*m


from sys import stdin, stdout
from collections import Counter, defaultdict
#from itertools import permutations, combinations
raw_input = stdin.readline
pr = stdout.write

def in_arr():
    return map(int,raw_input().split())

def pr_num(n):
    stdout.write(str(n)+'\n')

def pr_arr(arr):
    for i in arr:
        stdout.write(str(i)+' ')
    stdout.write('\n')

range = xrange # not for python 3.0+

# main code

for t in range(input()):
    n,m=in_arr()
    if n==1:
        ans=['B']*m
        ans[1]='W'
        pr(''.join(ans)+'\n')
    else:
        ans=[['B' for i in range(m)] for j in range(n)]
        ans[0][0]='W'
        for i in ans:
            pr(''.join(i)+'\n')


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    t = int(input())

    for _ in range(t):
        n, m = map(int, input().split())

        o = [['BW'[((i % 2) + (j % 2)) % 2] for j in range(m)] for i in range(n)]

        if (n * m) % 2 == 0:
            o[1][0] = 'B'

        print(*[''.join(i) for i in o], sep='\n')

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    t = int(input())

    for _ in range(t):
        n, m = map(int, input().split())

        o = [['BW'[((i % 2) + (j % 2)) % 2] for j in range(m)] for i in range(n)]
        o[-1][-1] = 'B'

        print(*[''.join(i) for i in o], sep='\n')

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


for t in xrange(int(raw_input())):
 n,m=map(int,raw_input().split())
 print 'W'+'B'*(m-1)
 for i in xrange(n-1): print 'B'*m


from sys import stdin

rints = lambda: [int(x) for x in stdin.readline().split()]
for _ in range(int(input())):
    n, m = rints()
    char, ans, ix = ['B', 'W'], [[] for _ in range(n)], 0

    for i in range(n):
        for j in range(m):
            ans[i].append(char[ix])
            ix ^= 1

    if (n * m) % 2 == 0:
        ans[0][1] = 'B'

    for i in ans:
        print(''.join(i))


"""Template for Python Competitive Programmers prepared by Mayank Chaudhary """

# to use the print and division function of Python3
from __future__ import division, print_function

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""use resource"""
# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])

"""for factorial"""

# def prepare_factorial():
#     fact = [1]
#     for i in range(1, 1000005):
#         fact.append((fact[-1] * i) % mod)
#     ifact = [0] * 1000005
#     ifact[1000004] = pow(fact[1000004], mod - 2, mod)
#     for i in range(1000004, 0, -1):
#         ifact[i - 1] = (i * ifact[i]) % mod
#
#     return fact, ifact

"""uncomment next 4 lines while doing recursion based question"""
import threading
threading.stack_size(1<<27)
import sys
sys.setrecursionlimit(10000)

"""uncomment modules according to your need"""
# from bisect import bisect_left, bisect_right, insort
# import itertools
# from math import floor, ceil, sqrt, degrees, atan, pi
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from collections import Counter, defaultdict, deque
# from copy import deepcopy
'''
def modinv(n, p):
    return pow(n, p - 2, p)
'''

# def ncr(n, r,  fact, ifact):  # for using this uncomment the lines calculating fact and ifact
#     t = (fact[n] * (ifact[r]*ifact[n-r]) % mod)% mod
#     return t

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()

# def GCD(x, y):
#     while (y):
#         x, y = y, x % y
#     return x
#
# def lcm(x, y):
#     return (x*y)//(GCD(x, y))

# def get_xor(n):
#     return [n,1,n+1,0][n%4]

# def binary_expo(a, b):
#
#     result = 1
#     while b:
#         if b&1:
#             result *= a
#             b-=1
#         else:
#             a *= a
#             b >>= 1
#     return result

"""*******************************************************"""

def main():

    T = int(input())
    while T:
        n, m = get_ints()
        mat = [['B' for i in range(m)] for j in range(n)]

        mat[-1][-1] = 'W'
        for i in mat:
            print(''.join(i))
        T-=1

""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip

    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

""" main function"""

if __name__ == '__main__':
    # main()
    threading.Thread(target=main).start()


"""Template for Python Competitive Programmers prepared by Mayank Chaudhary """

# to use the print and division function of Python3
from __future__ import division, print_function

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""use resource"""
# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])

"""for factorial"""

# def prepare_factorial():
#     fact = [1]
#     for i in range(1, 1000005):
#         fact.append((fact[-1] * i) % mod)
#     ifact = [0] * 1000005
#     ifact[1000004] = pow(fact[1000004], mod - 2, mod)
#     for i in range(1000004, 0, -1):
#         ifact[i - 1] = (i * ifact[i]) % mod
#
#     return fact, ifact

"""uncomment next 4 lines while doing recursion based question"""
import threading
threading.stack_size(1<<27)
import sys
sys.setrecursionlimit(10000)

"""uncomment modules according to your need"""
# from bisect import bisect_left, bisect_right, insort
# import itertools
# from math import floor, ceil, sqrt, degrees, atan, pi
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from collections import Counter, defaultdict, deque
# from copy import deepcopy
'''
def modinv(n, p):
    return pow(n, p - 2, p)
'''

# def ncr(n, r,  fact, ifact):  # for using this uncomment the lines calculating fact and ifact
#     t = (fact[n] * (ifact[r]*ifact[n-r]) % mod)% mod
#     return t

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()

# def GCD(x, y):
#     while (y):
#         x, y = y, x % y
#     return x
#
# def lcm(x, y):
#     return (x*y)//(GCD(x, y))

# def get_xor(n):
#     return [n,1,n+1,0][n%4]

# def binary_expo(a, b):
#
#     result = 1
#     while b:
#         if b&1:
#             result *= a
#             b-=1
#         else:
#             a *= a
#             b >>= 1
#     return result

"""*******************************************************"""

def main():

    T = int(input())
    while T:
        n, m = get_ints()

        mat = [['W' for i in range(m)] for j in range(n)]
        for j in range(1, m, 2):
            for i in range(n):
                mat[i][j] = 'B'
        if (n*m)&1:

            for i in range(0, n, 2):
                mat[i][-1] = 'B'
        else:
            mat[0][-2] = 'B'

        for i in mat:
            print(''.join(i))
        T-=1

""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip

    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

""" main function"""

if __name__ == '__main__':
    # main()
    threading.Thread(target=main).start()


import sys
import itertools

if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

#sys.stdin.readline().rstrip()
#sys.stdin.readline()
#sys.stdout.write("\n")

def pintarMatriz(filas,columnas):
    matriz = [None] * filas
    for raw in range(filas):
        matriz[raw] = [None] * columnas
    if((filas*columnas)%2 == 0):
        for raw in range(filas):
            for col in range(columnas):
                if((raw+col)%2 == 0):
                    matriz[raw][col] = "B"
                else:
                    matriz[raw][col] = "W"
        matriz[0][1] = "B"
    else:
        for raw in range(filas):
            for col in range(columnas):
                if((raw+col)%2 == 0):
                    matriz[raw][col] = "B"
                else:
                    matriz[raw][col] = "W"
    for raw in range(filas):
        for col in range(columnas):
            sys.stdout.write(matriz[raw][col])
        sys.stdout.write("\n")

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    for t in range(n):
        filas,columnas = [int(j) for j in sys.stdin.readline().rstrip().split(' ')]
        pintarMatriz(filas, columnas)


for k in range(int(input())):
    n,m=list(map(int,raw_input().split()))
    if n%2 and m%2:
        for i in range(n):
            if i%2:
                print('WB'*(m//2)+'W')
            else:
                print('BW'*(m//2)+'B')
    else:
        print('BB'+'BW'*(m//2-1)+'B'*(m%2))
        for i in range(1,n):
            if i%2:
                print('WB'*(m//2)+'W'*(m%2))
            else:
                print('BW'*(m//2)+'B'*(m%2))


for _ in range(input()):
	n, m = map(int, raw_input().split())
	for i in range(n-1):
		print 'B'*m
	print 'B'*(m-1)+'W'


from __future__ import division, print_function
# import threading
# threading.stack_size(2**27)
# import sys
# sys.setrecursionlimit(10**7)
from sys import stdin, stdout
import bisect            #c++ upperbound
import math
import heapq
def modinv(n,p):
    return pow(n,p-2,p)
def cin():
    return map(int,sin().split())
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
import math
def Divisors(n) :
    l = []
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) :
            if (n // i == i) :
                l.append(i)
            else :
                l.append(i)
                l.append(n//i)
    return l

q=[]
def dfs(n,d,v,c):
    global q
    v[n]=1
    x=d[n]
    q.append(n)
    j=c
    for i in x:
        if i not in v:
            f=dfs(i,d,v,c+1)
            j=max(j,f)
            # print(f)
    return j
"""*******************************************************"""
def main():
    t=inin()
    for _ in range(t):
        n,m=cin()
        s="B"*m
        for i in range(n):
            if(i==0):
                print("W"+s[1:])
            else:
                print(s)

######## Python 2 and 3 footer by Pajenegod and c1729

# Note because cf runs old PyPy3 version which doesn't have the sped up
# unicode strings, PyPy3 strings will many times be slower than pypy2.
# There is a way to get around this by using binary strings in PyPy3
# but its syntax is different which makes it kind of a mess to use.

# So on cf, use PyPy2 for best string performance.

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Cout implemented in Python
import sys
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'R' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'R' [0]:
        A.append(sign*numb)
    return A

# threading.Thread(target=main).start()
if __name__== "__main__":
  main()


#from __future__ import print_function
mod=int(1e9+7)
#import resource
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#import threading
#threading.stack_size(2**28)
#import sys
#sys.setrecursionlimit(10**6)
#fact=[1]
#for i in range(1,100001):
#    fact.append((fact[-1]*i)%mod)
#ifact=[0]*100001
#ifact[100000]=pow(fact[100000],mod-2,mod)
#for i in range(100000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
#from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl              #c++ lowerbound bl(array,element)
from bisect import bisect_right as br             #c++ upperbound
import itertools
import collections
import math
import heapq
#from random import randint as rn
def modinv(n,p):
    return pow(n,p-2,p)
def ncr(n,r,p):                        #for using this uncomment the lines calculating fact and ifact
    t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p
    return t
def GCD(x,y):
    while(y):
        x, y = y, x % y
    return x
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
"""*******************************************************"""
def main():
    for i in range(int(sin())):
        n,m=ain()
        s="W"+("B"*(m-1))
        print s
        for i in range(n-1):
            print "B"*m
######## Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s
    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
if __name__ == '__main__':
   main()
#threading.Thread(target=main).start()


import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''

for _ in xrange(RN()):
    n,m = RI()
    mat = [['B']*m for i in xrange(n)]
    mat[0][0] = 'W'

    for row in mat:
        print ''.join(row)


import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''

for _ in xrange(RN()):
    n,m = RI()
    ans = [ ['W']*m for i in xrange(n)]

    for i in xrange(n):
        ans[i][0] = 'B'

    for i in xrange(m):
        ans[0][i] = 'B'

    for row in ans:
        print ''.join(map(str,row))


input = raw_input

def answer():
    h, w = map(int, input().split(" "))
    one_line = "BW" * (w // 2)
    if w % 2 == 1:
        one_line += "B"
    second_line = "WB" * (w // 2)
    if w % 2 == 1:
        second_line += "W"

    for i in range(h-1):
        if i % 2 == 0:
            print(one_line)
        else:
            print(second_line)

    last_line = second_line if h % 2 == 0 else one_line
    if (h * w) % 2 == 0:
        last_line = last_line[:-1] + "B"
    print(last_line)

t = int(input())
for _ in range(t):
    answer()


input = raw_input

def answer():
    h, w = map(int, input().split(" "))
    one_line = "BW" * (w // 2)
    if w % 2 == 1:
        one_line += "B"
    second_line = "WB" * (w // 2)
    if w % 2 == 1:
        second_line += "W"

    if w % 2 == 0 and h % 2 == 0:
        tmp = one_line
        one_line = second_line
        second_line = tmp

    for i in range(h-1):
        if i % 2 == 0:
            print(one_line)
        else:
            print(second_line)

    last_line = second_line if h % 2 == 0 else one_line
    if (h * w) % 2 == 0:
        last_line = last_line[:-1] + "B"
    print(last_line)

t = int(input())
for _ in range(t):
    answer()


from __future__ import division, print_function
__interactive = False

def main():
    for _ in range(int(input())):
        n, m = input_as_list()
        print('W'+'B'*(m-1))
        for _ in range(n-1):
           print('B'*m)

INF = float('inf')
MOD = 10 ** 9 + 7
alphabets = 'abcdefghijklmnopqrstuvwxyz'

import os, sys
sys.modules["hashlib"] = sys.sha512 = sys
from atexit import register
from io import BytesIO
import itertools
import __pypy__

if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

if "LOCAL_" in os.environ:
    debug_print = print
else:
    if not __interactive:
        sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
        sys.stdout = BytesIO()
        register(lambda: os.write(1, sys.stdout.getvalue()))

        input = lambda: sys.stdin.readline().rstrip('\r\n')
    debug_print = lambda *x, **y: None

flush = sys.stdout.flush

def mulmod(x, y):
    return __pypy__.intop.int_mulmod(x, y, MOD)

def modinv(x):
    return pow(x, MOD-2, MOD)

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def input_as_list():
    return [int(x) for x in input().split()]

def input_with_offset(o):
    return [int(x)+o for x in input().split()]

def input_as_matrix(n, m):
    return [input_as_list() for _ in range(n)]

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

def range_with_count(start, step, count):
    return range(start, start + step * count, step)

def indices(l, start=0, end=0):
    return range(start, len(l)+end)

def ceil_power_of_2(n):
    """ [0, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, ...] """
    return 2 ** ((n - 1).bit_length())

def ceil_div(x, r):
    """ = ceil(x / r) """
    return (x + r - 1) // r

main()


import sys
range = xrange
input = raw_input

out = []
t = int(input())
for _ in range(t):
    n,m = [int(x) for x in input().split()]
    out.append('W' + 'B'*(m - 1))
    for _ in range(n - 1):
        out.append('B'*m)
print '\n'.join(out)


from sys import stdin, stdout
T=int(stdin.readline())
for p in xrange(T):
    n,m=map(int, stdin.readline().split())
    ans=''
    for i in xrange(m-1):
        ans+='B'
    ans+='W'
    ans+='\n'
    for i in xrange(n-1):
        for j in xrange(m):
            ans+='B'
        ans+='\n'
    stdout.write(ans)


for _ in range(input()):
    n,m=map(int,raw_input().split())
    print("B"*m)
    for j in range(n-1):
        print(("B"*(m-1))+"W")


"""
    Satwik_Tiwari ;) .
    4th july , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def bs(a,l,h,x):
    while(l<h):
        # print(l,h)
        mid = (l+h)//2
        if(a[mid] == x):
            return mid
        if(a[mid] < x):
            l = mid+1
        else:
            h = mid
    return l

def sieve(a): #O(n loglogn) nearly linear
    #all odd mark 1
    for i in range(3,((10**6)+1),2):
        a[i] = 1
    #marking multiples of i form i*i 0. they are nt prime
    for i in range(3,((10**6)+1),2):
        for j in range(i*i,((10**6)+1),i):
            a[j] = 0
    a[2] = 1 #special left case
    return (a)

def bfs(g,st):
    visited = [-1]*(len(g))
    visited[st] = 0
    queue = []
    queue.append(st)
    new = []
    while(len(queue) != 0):
        s = queue.pop()
        new.append(s)
        for i in g[s]:
            if(visited[i] == -1):
                visited[i] = visited[s]+1
                queue.append(i)
    return visited

def dfsusingstack(v,st):
    d = deque([])
    visited = [0]*(len(v))
    d.append(st)
    new = []
    visited[st] = 1
    while(len(d) != 0):
        curr = d.pop()
        new.append(curr)
        for i in v[curr]:
            if(visited[i] == 0):
                visited[i] = 1
                d.append(i)
    return new

def solve():
    n,m = sep()
    grid = [[0]*(m) for i in range(n)]
    for i in range(0,n):
        for j in range(0,m):
            if(i==0 and j==0):
                grid[i][j] = 'W'
                continue
            grid[i][j] = 'B'
    for i in range(0,n):
        print("".join(grid[i]))

# testcase(1)
testcase(int(inp()))


"""
    Satwik_Tiwari ;) .
    4th july , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def bs(a,l,h,x):
    while(l<h):
        # print(l,h)
        mid = (l+h)//2
        if(a[mid] == x):
            return mid
        if(a[mid] < x):
            l = mid+1
        else:
            h = mid
    return l

def sieve(a): #O(n loglogn) nearly linear
    #all odd mark 1
    for i in range(3,((10**6)+1),2):
        a[i] = 1
    #marking multiples of i form i*i 0. they are nt prime
    for i in range(3,((10**6)+1),2):
        for j in range(i*i,((10**6)+1),i):
            a[j] = 0
    a[2] = 1 #special left case
    return (a)

def bfs(g,st):
    visited = [-1]*(len(g))
    visited[st] = 0
    queue = []
    queue.append(st)
    new = []
    while(len(queue) != 0):
        s = queue.pop()
        new.append(s)
        for i in g[s]:
            if(visited[i] == -1):
                visited[i] = visited[s]+1
                queue.append(i)
    return visited

def dfsusingstack(v,st):
    d = deque([])
    visited = [0]*(len(v))
    d.append(st)
    new = []
    visited[st] = 1
    while(len(d) != 0):
        curr = d.pop()
        new.append(curr)
        for i in v[curr]:
            if(visited[i] == 0):
                visited[i] = 1
                d.append(i)
    return new

def solve():
    n,m = sep()
    grid = [[0]*(m) for i in range(n)]
    for i in range(0,n):
        for j in range(0,m):
            if(i==0 and j==0):
                grid[i][j] = 'B'
                continue
            grid[i][j] = 'W'
    for i in range(0,n):
        print("".join(grid[i]))

# testcase(1)
testcase(int(inp()))


from sys import stdout

for _ in xrange(input()):
    n, m = map(int, raw_input().strip().split())
    p = n * m

    l = []
    if p & 1:
        for i in xrange(n):
            if i & 1: st = 'W'
            else: st = 'B'
            l = []
            for j in xrange(m):
                l.append(st)
                if st == 'B': st = 'W'
                else: st = 'B'

            stdout.write(''.join(l))
            stdout.write('\n')
    else:
        grid = [[0 for i in xrange(m)] for j in xrange(n)]
        for i in xrange(n):
            if i & 1: st = 'B'
            else: st = 'W'
            for j in xrange(m):
                grid[i][j] = st
                if st == 'B': st = 'W'
                else: st = 'B'

        grid[0][0] = 'B'
        for i in xrange(n):
            stdout.write(''.join(grid[i]))
            stdout.write('\n')


import sys
#
# inp = map(int, sys.stdin.read().split())

n = int(sys.stdin.readline())
for i in xrange(n):
    a, b = map(int, sys.stdin.readline().split())
    arr = [['W'] * b for j in xrange(a)]
    for j in xrange(b):
        arr[-1][j] = 'B'
    for j in xrange(a):
        arr[j][-1] = 'B'

    for x in arr:
        print(''.join(x))


T = input()
for t in range(T) :
  N, M = map(int,raw_input().split())
  print 'W' + 'B'*(M-1)
  for n in range(N-1) : print 'B'*M


'''input
2
3 2
3 3
'''

import sys
import math
from collections import Counter

debug = 1
readln = sys.stdin.readline
#sys.setrecursionlimit(1000000)

def write(s):
    sys.stdout.write(str(s))

def writeln(s):
    sys.stdout.write(str(s))
    sys.stdout.write('\n')

def readint():
    return int(readln().strip())

def readints():
    return map(int, readln().split())

def readstr():
    return readln().strip()

def readstrs():
    return readln().split()

def dbg(*args):
    if debug: print(' '.join(map(str, args)))

t = readint()
for _ in xrange(t):
    n,m = readints()
    print 'W' + 'B' * (m-1)
    for _ in xrange(n-1):
        print 'B' * m


def read_test():
	n, m = [int(x) for x in raw_input().split(" ")]
	return (n, m)

def solve(n, m):
	result = []
	c = n % 2 == 1 or m % 2 == 1
	for i in range(n):
		line = [None] * m
		for j in range(m):
			line[j] = "B" if c else "W"
			c = not c
		result.append(line)
		if m % 2 == 0:
			c = not c

	result[-1][-1] = "B"
	return result

n = int(raw_input())
for i in range(n):
	result = solve(*read_test())
	for line in result:
		print("".join(str(x) for x in line))


def read_test():
	n, m = [int(x) for x in raw_input().split(" ")]
	return (n, m)

def solve(n, m):
	result = []
	c = n % 2 == 1 or m % 2 == 1
	for i in range(n):
		line = [None] * m
		for j in range(m):
			line[j] = "W" if c else "B"
			c = not c
		result.append(line)
		if m % 2 == 0:
			c = not c

	result[-1][-1] = "W"
	return result

n = int(raw_input())
for i in range(n):
	result = solve(*read_test())
	for line in result:
		print("".join(str(x) for x in line))


import bisect
import os
import io
from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce
from collections import deque
import threading
from itertools import combinations

# sys.setrecursionlimit(200000)
# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def input():
    return sys.stdin.readline().strip()

def iinput():
    return int(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rlinput():
    return list(rinput())

mod = int(1e9)+7

def factors(n):
    return set(reduce(list.__add__,
                      ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

# ----------------------------------------------------
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')
def solve():
    pass
if __name__ == "__main__":
    for _ in range(iinput()):
        n,m=rinput()
        if n==1:
            print('BW'*((m-1)//2)+'B')
        elif m==1:
            for i in range(n):
                if i%2:
                    print('W')
                else:
                    print('B')
        elif (n*m)%2:
            for i in range(n-1):
                if i%2:
                    print('W'*m)
                else:
                    print('B'*m)
            print('BW'*((m-1)//2)+'B')
        else:
            print('B'*m)
            for i in range(1,n-1):
                if i%2:
                    if i==1:
                        print('B'+'W'*(m-1))
                    else:
                        print('W'*m)
            if n%2:
                print('BW'*(m//2))
            else:
                print('W'*m)


import bisect
import os
import io
from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce
from collections import deque
import threading
from itertools import combinations

# sys.setrecursionlimit(200000)
# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def input():
    return sys.stdin.readline().strip()

def iinput():
    return int(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rlinput():
    return list(rinput())

mod = int(1e9)+7

def factors(n):
    return set(reduce(list.__add__,
                      ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

# ----------------------------------------------------
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')
def solve():
    pass

if __name__ == "__main__":
    for _ in range(iinput()):
        n, m = rinput()
        if n == 1:
            print('BW'*((m-1)//2)+'B')
        elif m == 1:
            for i in range(n):
                if i % 2:
                    print('W')
                else:
                    print('B')
        elif (n*m) % 2:
            for i in range(n-1):
                if i % 2:
                    print('W'*m)
                else:
                    print('B'*m)
            print('BW'*((m-1)//2)+'B')
        else:
            print('B'*m)
            for i in range(1, n-1):
                if i % 2:
                    if i == 1:
                        print('B'+'W'*(m-1))
                    else:
                        print('W'*m)
                else:
                    print('B'*m)
            if n == 2:
                print('B'+'W'*(m-1))
            elif n % 2:
                print('B'*m)
            else:
                print('W'*m)


import bisect
import os
import io
from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce
from collections import deque
import threading
from itertools import combinations

# sys.setrecursionlimit(200000)
# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def input():
    return sys.stdin.readline().strip()

def iinput():
    return int(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rlinput():
    return list(rinput())

mod = int(1e9)+7

def factors(n):
    return set(reduce(list.__add__,
                      ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

# ----------------------------------------------------
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')
def solve():
    pass

if __name__ == "__main__":
    for _ in range(iinput()):
        n, m = rinput()
        if n == 1:
            print('BW'*((m-1)//2)+'B')
        elif m == 1:
            for i in range(n):
                if i % 2:
                    print('W')
                else:
                    print('B')
        elif (n*m) % 2:
            for i in range(n-1):
                if i % 2:
                    print('W'*m)
                else:
                    print('B'*m)
            print('BW'*((m-1)//2)+'B')
        else:
            print('B'*m)
            for i in range(1, n-1):
                if i % 2:
                    if i == 1:
                        print('B'+'W'*(m-1))
                    else:
                        print('W'*m)
                else:
                    print('B'*m)
            if n == 2:
                print('B'+'W'*(m-1))
            elif n % 2:
                print('BW'*(m//2))
            else:
                print('W'*m)


import bisect
import os
import io
from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce
from collections import deque
import threading
from itertools import combinations

# sys.setrecursionlimit(200000)
# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def input():
    return sys.stdin.readline().strip()

def iinput():
    return int(input())

def tinput():
    return input().split()

def rinput():
    return map(int, tinput())

def rlinput():
    return list(rinput())

mod = int(1e9)+7

def factors(n):
    return set(reduce(list.__add__,
                      ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

# ----------------------------------------------------
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')
def solve():
    pass
if __name__ == "__main__":
    for _ in range(iinput()):
        n,m=rinput()
        if n==1:
            print('BW'*m)
        elif m==1:
            for i in range(n):
                if i%2:
                    print('W')
                else:
                    print('B')
        elif (n*m)%2:
            for i in range(n-1):
                if i%2:
                    print('W'*m)
                else:
                    print('B'*m)
            print('BW'*((m-1)//2)+'B')
        else:
            print('B'*m)
            for i in range(1,n-1):
                if i%2:
                    if i==1:
                        print('B'+'W'*(m-1))
                    else:
                        print('W'*m)
            if n%2:
                print('BW'*(m//2))
            else:
                print('W'*m)


t = int(input())
vars = []

for i in range(t):
    s = input()
    n, m = [int(c) for c in s.split(' ')]
    vars.append(n)
    vars.append(m)

for i in range(t):
    n = vars[i*2]
    m = vars[i*2+1]

    half = int(n / 2)
    if n%2==0:
        print(str('B'*m))
        print(str('W'*(m-1))+'B')
        if half>1:
            for i in range(half-1):
                print(str('B' * m))
                print(str('W' * m))

    else:
        if half>0:
            for i in range(half):
                print(str('B'*m))
                print(str('W'*m))
        if m%2==0:
            print('BW'*(int(m/2)-1)+'BB')
        else:
            print('B'+int(m/2)*'WB')


t = int(input())
vars = []

for i in range(t):
    s = input()
    n, m = [int(c) for c in s.split(' ')]
    vars.append(n)
    vars.append(m)

for i in range(t):
    n = vars[i*2]
    m = vars[i*2+1]

    half = int(n / 2)
    if n%2==0:
        print(str('B'*m))
        print(str('W'*(m-1))+'B')
        if half>1:
            for i in range(half-1):
                print(str('B' * m))
                print(str('W' * m))

    else:
        if half>0:
            for i in range(half):
                print(str('W'*m))
                print(str('B'*m))
        if m%2==0:
            print('BW'*(int(m/2)-1)+'BB')
        else:
            print('B'+int(m/2)*'WB')


t = int(input())
vars = []

for i in range(t):
    s = input()
    n, m = [int(c) for c in s.split(' ')]
    vars.append(n)
    vars.append(m)

for i in range(t):
    n = vars[i*2]
    m = vars[i*2+1]

    half = int(n / 2)
    if n%2==0:
        print(str('B'*m))
        print(str('W'*(m-1))+'B')
        if half>1:
            for i in range(half-1):
                print(str('B' * m))
                print(str('W' * m))

    else:
        if half>0:
            for i in range(half):
                print(str('W'*m))
                print(str('B'*m))
        if m%2==0:
            if m==2:
                print('BW')
            else:
                print('BW'*(int(m/2)-1)+'BB')
        else:
            print('B'+int(m/2)*'WB')


t = int(input())
vars = []

for i in range(t):
    s = input()
    n, m = [int(c) for c in s.split(' ')]
    vars.append(n)
    vars.append(m)

for i in range(t):
    n = vars[i*2]
    m = vars[i*2+1]

    # half = int(n / 2)
    # if n%2==0:
    #     print(str('B'*m))
    #     print(str('W'*(m-1))+'B')
    #     if half>1:
    #         for i in range(half-1):
    #             print(str('B' * m))
    #             print(str('W' * m))
    #
    # else:
    #     if half>0:
    #         for i in range(half):
    #             print(str('W'*m))
    #             print(str('B'*m))
    #     if m%2==0:
    #         if m==2:
    #             print('BW')
    #         else:
    #             print('BW'*(int(m/2)-1)+'BB')
    #     else:
    #         print('B'+int(m/2)*'WB')

    s = 'BW'*m
    ans = []
    for i in range(n):
        if i%2==0:
            ans.append(s[:m])
        else:
            ans.append(s[1:m+1])
    if m*n%2==0:
        ans[0] = ans[0].replace('W', 'B', 1)
    for i in range(n):
        print(ans[i])


t = int(input())
for arisetni in range(t):
    n, m = (int(x) for x in input().split())
    for i in range(n):
        for j in range(m):
            if i == j == 0:
                print('B', end='')
            elif (j + i % 2) % 2 == 0:
                print('W', end='')
            else:
                print('B', end='')
        print()


for st in range(int(input())):
    n, m = (int(x) for x in input().split())
    for i in range(n):
        if i == 1 and (n * m) % 2 == 0:
            print('B' + 'W' * (m - 1))
        elif i % 2:
            print('W' * m)
        else:
            print('B' * m)


t = int(input())
for arisetni in range(t):
    n, m = (int(x) for x in input().split())
    for i in range(n):
        for j in range(m):
            if i == 0 and j == 1 and (n * m) % 2 == 0:
                print('B', end='')
            elif (j + i % 2) % 2 == 0:
                print('B', end='')
            else:
                print('W', end='')
        print()


t = int(input())
for arisetni in range(t):
    n, m = (int(x) for x in input().split())
    for i in range(n):
        for j in range(m):
            if i == j == 0:
                print('W', end='')
            elif (j + i % 2) % 2 == 0:
                print('B', end='')
            else:
                print('W', end='')
        print()


t = int(input())

for _ in range(t):
    n, m = map(int, input().split())
    s = ""
    c = 0
    for i in range(n):
        s += 'B' if c else 'W'
        c = 0 if c else 1
    for i in range(m):
        print(s)


t = int(input())

for _ in range(t):
    n, m = map(int, input().split())
    s1, s2 = "", ""
    c = 0
    s = "W" + "B" * (m-1)
    print(s)
    for i in range(n-1):
        print("B" * m)


t = int(input())

for _ in range(t):
    n, m = map(int, input().split())
    s1, s2 = "", ""
    c = 0
    M = [['' for i in range(m)] for i in range(n)]

    for i in range(n):
        for x in range(m):
            if x % 2 == 0:
                M[i][x] = 'B'
            else:
                M[i][x] = 'W'
    #print(M)
    if m % 2 == 0:
        for i in M[:-1]:
            print("".join(i))
        f = M[-1]
        f[-1] = 'B'
        print("".join(f))
        continue
    else:
        B = n * (m + 1)// 2
        W = m * n - B
        Wold = W
        Bold = B
        #print(W, B)

        while B != W + 1:
            B -= 1
            W += 1

        req = W - Wold

       # print(req)

        for i in range(0, 2 * req, 2):
            M[i][-1] = "W"

        for i in M:
            print("".join(i))
    """
    for i in range(m):
        s1 += 'B' if c % 2 else 'W'
        s2 += 'W' if c % 2 else 'B'
        c = 0 if c else 1

    c = 0
    for i in range(n-1):
        print(s1 if c else s2)
        c = 0 if c else 1
    """


t = int(input())

for _ in range(t):
    n, m = map(int, input().split())
    s = ""
    c = 0
    for i in range(m):
        s += 'B' if c else 'W'
        c = 0 if c else 1
    for i in range(n):
        print(s)


for _ in range(int(input())):
    r , c = list(map(int,input().split()))

    if c%2==0:
        for i in range(r-1):
            print("BW"*(c//2))
        print("BB"+"BW"*(c//2-1))
        continue
    if  r%2 ==0:
        for i in range(r//2 -1 ):
            print("W"*c)
            print("B"*c)
        print("W"*(c-1) + "B" )
        print("B"*c)
        continue
    else:
        for i in range(r//2  ):
            print("BW"*(c//2)+ "B")
            print("WB"*(c//2)+ "W")
        print("BW"*(c//2)+ "B")
        continue


for _ in range(int(input())):
    r , c = list(map(int,input().split()))

    if c%2==0:
        for i in range(r-1):
            print("BW"*(c//2))
        print("BB"+"BW"*(c//2-2))
        continue
    if  r%2 ==0:
        for i in range(r//2 -1 ):
            print("W"*c)
            print("B"*c)
        print("W"*(c-1) + "B" )
        print("B"*c)
        continue
    else:
        for i in range(r//2  ):
            print("BW"*(c//2)+ "B")
            print("WB"*(c//2)+ "W")
        print("BW"*(c//2)+ "B")
        continue


for _ in range(int(input())):
    r , c = list(map(int,input().split()))

    if c%2==0:
        for i in range(r-1):
            print("BW"*(c//2))
        print("B"*c)
        continue
    if  r%2 ==0:
        for i in range(r//2 -1 ):
            print("W"*c)
            print("B"*c)
        print("W"*(c-1) + "B" )
        print("B"*c)
        continue
    else:
        for i in range(r//2  ):
            print("BW"*(c//2)+ "B")
            print("WB"*(c//2)+ "W")
        print("BW"*(c//2)+ "B")
        continue


t= int(input())
for _ in range(t):
    n,m = map(int,input().split())
    r1= ''
    r2=''
    for i in range(m):
        if i%2==0:
            r1 += 'B'
            r2 += 'W'
        else:
            r1 += 'W'
            r2 += 'B'
    if n%2==1 and m%2==1:
        for i in range(n):
            if i%2==1:
                print(r1)
            else:
                print(r2)
    elif n%2 != m%2:
        for i in range(n):
            if i==n-1:
                if i%2==0:
                    print(r1[:-1]+'B')
                else:
                    print(r2[:-1]+'B')
            else:
                if i%2==0:
                    print(r1)
                else:
                    print(r2)
    elif n%2==0 and m%2==0:
        for i in range(n):
            if i==0:
                print(r1[:-1]+'B')
            else:
                if i%2==0:
                    print(r1)
                else:
                    print(r2)


t= int(input())
for _ in range(t):
    n,m = map(int,input().split())
    r1= ''
    r2=''
    for i in range(m):
        if i%2==0:
            r1 += 'B'
            r2 += 'W'
        else:
            r1 += 'W'
            r2 += 'B'
    if n%2==1 and m%2==1:
        for i in range(n):
            if i%2==1:
                print(r1)
            else:
                print(r2)
    else:
        for i in range(n):
            if i==n-1:
                print(r1[:-1]+'B')
            else:
                if i%2==1:
                    print(r1)
                else:
                    print(r2)


t= int(input())
for _ in range(t):
    n,m = map(int,input().split())
    r1= ''
    r2=''
    for i in range(m):
        if i%2==0:
            r1 += 'B'
            r2 += 'W'
        else:
            r1 += 'W'
            r2 += 'B'
    if n%2==1 and m%2==1:
        for i in range(1,n+1):
            if i%2==1:
                print(r1)
            else:
                print(r2)
    elif n%2 != m%2:
        for i in range(1,n+1):
            if i==n:
                if i%2==1:
                    print(r1[:-1]+'B')
                else:
                    print(r2[:-1]+'B')
            else:
                if i%2==1:
                    print(r1)
                else:
                    print(r2)
    elif n%2==0 and m%2==0:
        for i in range(1,n+1):
            if i==1:
                print(r1[:-1]+'B')
            else:
                if i%2==1:
                    print(r1)
                else:
                    print(r2)


t= int(input())
for _ in range(t):
    n,m = map(int,input().split())
    r1= ''
    r2=''
    for i in range(m):
        if i%2==0:
            r1 += 'B'
            r2 += 'W'
        else:
            r1 += 'W'
            r2 += 'B'
    for i in range(n):
        if i%2==0:
            print(r1)
        else:
            print(r2)


t= int(input())
for _ in range(t):
    n,m = map(int,input().split())
    r1= ''
    r2=''
    for i in range(m):
        if i%2==0:
            r1 += 'B'
            r2 += 'W'
        else:
            r1 += 'W'
            r2 += 'B'
    if n%2==1 and m%2==1:
        for i in range(n):
            if i%2==1:
                print(r1)
            else:
                print(r2)
    else:
        for i in range(n):
            if i==n-1:
                print(r1 -r1[-1]+'B')
            else:
                if i%2==1:
                    print(r1)
                else:
                    print(r2)


t = int(input())
for  _ in range(t):
    n,m = map(int,input().split())
    x = n*m
    if ((x-1)//2) % 2 != 0:
        a = ((x-1)//2) + 1
        b = x - a
    else:
        a = ((x-1)//2)
        b = x - a
    if b>a:
        a,b = b,a
    j = 0
    for i in range(n):
        if i==n-1:
            print("B"*(a)+("W")*b)
            break
        for j in range(m):
            if i%2  == 0 and j%2==0:
                print("B",end="")
                a-=1
            elif i%2  == 0 and j%2!=0:
                print("W",end="")
                b-=1
            elif i%2  != 0 and j%2==0:
                print("W",end="")
                b-=1
            elif i%2  != 0 and j%2!=0:
                print("B",end="")
                a-=1
        print()


t = int(input())
for  _ in range(t):
    n,m = map(int,input().split())
    x = n*m
    a = ((x-1)//2) + 1
    b = x - a
    if b>a:
        a,b = b,a
    if a==b:
        a+=1
        b-=1
    j = 0
    for i in range(n):
        if i==n-1:
            print("B"*(a)+("W")*b)
            break
        for j in range(m):
            if i%2  == 0 and j%2==0:
                print("B",end="")
                a-=1
            elif i%2  == 0 and j%2!=0:
                print("W",end="")
                b-=1
            elif i%2  != 0 and j%2==0:
                print("W",end="")
                b-=1
            elif i%2  != 0 and j%2!=0:
                print("B",end="")
                a-=1
        print()


t = int(input())
for _ in range(t):
    l, b = [int(_i) for _i in input().split()]
    if l*b % 2 != 0:
        n1 = (l*b + 1)//2
        n2 = n1 - 1
        for i in range(l):
            if i % 2 == 0:
                print('B' + 'WB'*(b//2))
            else:
                print('W' + 'BW'*(b//2))
    else:
        n1 = l*b // 2 + 1
        n2 = l*b - n1
        print('B'*b)
        print('B' + 'W'*(b-1))
        if b % 2 == 0:
            for i in range(2, l):
                if i % 2 == 0:
                    print('BW'*(b//2))
                else:
                    print('WB'*(b//2))
        else:
            for i in range(2, l):
                if i % 2 == 0:
                    print('B' + 'WB'*(b//2))
                else:
                    print('W' + 'BW'*(b//2))


t = int(input())
for _ in range(t):
    l, b = [int(_i) for _i in input().split()]
    if l*b % 2 != 0:
        n1 = (l*b + 1)//2
        n2 = n1 - 1
        for i in range(l):
            if i % 2 == 0:
                print('B' + 'WB'*(b//2))
            else:
                print('W' + 'BW'*(b//2))
    else:
        n1 = l*b // 2 + 1
        n2 = l*b - n1
        for i in range(l):
            if i == l - 1:
                print('B'*n1 + 'W'*n2)
                break
            if i == 1:
                print('B' + 'W'*(b - 1))
                n1 -= 1
                n2 -= b - 1
            elif i % 2 == 0:
                print('B'*b)
                n1 -= b
            else:
                print('W'*b)
                n2 -= b


t = int(input())
for _ in range(t):
    l, b = [int(_i) for _i in input().split()]
    if l*b % 2 != 0:
        n1 = (l*b + 1)//2
        n2 = n1 - 1
        for i in range(l):
            if i == l - 1:
                print('B'*n1 + 'W'*n2)
                break
            if i % 2 == 0:
                print('B'*b)
                n1 -= b
            else:
                print('W'*b)
                n2 -= b
    else:
        n1 = l*b // 2 + 1
        n2 = l*b - n1
        for i in range(l):
            if i == l - 1:
                print('B'*n1 + 'W'*n2)
                break
            if i == 1:
                print('B' + 'W'*(b - 1))
                n1 -= 1
                n2 -= b - 1
            elif i % 2 == 0:
                print('B'*b)
                n1 -= b
            else:
                print('W'*b)
                n2 -= b


t = int(input())
for _ in range(t):
    l, b = [int(_i) for _i in input().split()]
    if l*b % 2 != 0:
        n1 = (l**2 + 1)//2
        n2 = n1 - 1
        for i in range(l):
            if i == l - 1:
                print('B'*n1 + 'W'*n2)
                break
            if i % 2 == 0:
                print('B'*b)
                n1 -= b
            else:
                print('W'*b)
                n2 -= b
    else:
        n1 = l*b // 2 + 1
        n2 = l*b - n1
        for i in range(l):
            if i == l - 1:
                print('B'*n1 + 'W'*n2)
                break
            if i == 1:
                print('B' + 'W'*(b - 1))
                n1 -= 1
                n2 -= b - 1
            elif i % 2 == 0:
                print('B'*b)
                n1 -= b
            else:
                print('W'*b)
                n2 -= b


t = int(input())
for _ in range(t):
    l, b = [int(_i) for _i in input().split()]
    if l*b % 2 != 0:
        n1 = (l*b + 1)//2
        n2 = n1 - 1
        for i in range(l):
            if i % 2 == 0:
                print('B' + 'WB'*(b//2))
            else:
                print('W' + 'BW'*(b//2))
    else:
        n1 = l*b // 2 + 1
        n2 = l*b - n1
        for i in range(l):
            if i == 0:
                print('B'*b)
            elif i == 1:
                print('B' + 'W'*(b - 1))
            elif i % 2 == 0:
                print('BW'*(b//2))
            else:
                print('WB'*(b//2))


from sys import stdin, stdout
t = int(stdin.readline())
while t>0:
    n, m = map( int,stdin.readline().split())
    ans = [[ 'B' for i in range(m) ] for j in range(n) ]
    for i in range(n):
        if i%2==0:
            for j in range(m):
                if j%2==1:
                    ans[i][j]='W'
        else:
            for j in range(m):
                if j%2==0:
                    ans[i][j]='W'

    if ans[n-1][m-1]=='W':
        ans[-1][-1] = 'B'
    else:
        if ans[n-1][m-2]=='W':
            ans[-1][m-2]='B'
    for i in range(n):
        for j in range(m):
            stdout.write("{}".format(ans[i][j]))
        stdout.write("\n")
    t-=1


from sys import stdin, stdout
t = int(stdin.readline())
while t>0:
    n, m = map( int,stdin.readline().split())
    ans = [[ 'B' for i in range(m) ] for j in range(n) ]
    for i in range(n):
        if i%2==0:
            for j in range(m):
                if j%2==1:
                    ans[i][j]='W'
        else:
            for j in range(m):
                if j%2==0:
                    ans[i][j]='W'
    for i in range(n):
        for j in range(m):
            stdout.write("{}".format(ans[i][j]))
        stdout.write("\n")
    t-=1


from sys import stdin, stdout
t = int(stdin.readline())
while t>0:
    n, m = map( int,stdin.readline().split())
    ans = [[ 'B' for i in range(m) ] for j in range(n) ]
    ans[-1][-1]='W'

    for i in range(n):
        for j in range(m):
            stdout.write("{}".format(ans[i][j]))
        stdout.write("\n")
    t-=1


t = int(input())
for queries in range(t):
    n, m = map(int,input().split())
    l = []
    for _ in range(n):
        l.append([0] * m)
    for i in range(n):
        for j in range(m):
            if (i+j) % 2 == 0:
                l[i][j] = 'B'
            else:
                l[i][j] = 'W'
    if n % 2 == 0:
        l[n-1][0] = 'B'
    elif m % 2 == 0:
        l[0][m-1] = 'B'
    for line in l:
        print(''.join(line))

#if both odd
# BWBWB
# WBWBW
# BWBWB

#if some even
# BWBW
# WBWB
# BWBB

# BWBWB
# WBWBB

# BWBW
# WBBB


t = int(input())
for queries in range(t):
    n, m = map(int,input().split())
    l = []
    for _ in range(n):
        l.append([0] * m)
    for i in range(n):
        for j in range(m):
            if (i+j) % 2 == 0:
                l[i][j] = 'B'
            else:
                l[i][j] = 'W'
    if n * m % 2 == 0:
        l[n-1][m-1] = 'B'
    for line in l:
        print(''.join(line))

#if both odd
# BWBWB
# WBWBW
# BWBWB

#if some even
# BWBW
# WBWB
# BWBB

# BWBWB
# WBWBB

# BWBW
# WBBB


t = int(input())
for queries in range(t):
    n, m = map(int,input().split())
    l = []
    for _ in range(n):
        l.append([0] * m)
    for i in range(n):
        for j in range(m):
            if (i+j) % 2 == 0:
                l[i][j] = 'B'
            else:
                l[i][j] = 'W'
    if n % 2 == 0:
        l[n-1][0] = 'B'
    else if m % 2 == 0:
        l[0][m-1] = 'B'
    for line in l:
        print(''.join(line))

#if both odd
# BWBWB
# WBWBW
# BWBWB

#if some even
# BWBW
# WBWB
# BWBB

# BWBWB
# WBWBB

# BWBW
# WBBB


t=int(input())
for _ in range(t):
    #n=int(input())
    n,m=map(int,input().split())
    if (n*m)%2==0:
        b=(n*m)//2
        w=b
    else:
        b=(n*m)//2+1
        w=(n*m)//2
    for i in range(n):
        for j in range(m):
            if i==0 and j==0:
                print('B',end="")
                b-=1
            elif i==0 and j==1:
                print('W',end="")
                w-=1
            else:
                if b>0:
                    b-=1
                    print('B',end="")
                else:
                    print('W',end="")
        print()
    #c=[[0 for i in range(k)] for j in range(n)]
    #ans=0


t=int(input())
for _ in range(t):
    #n=int(input())
    n,m=map(int,input().split())
    for i in range(n):
        for j in range(m):
            if i==0 and j==0:
                print('W',end="")
            else:
                print('B',end="")
        print()
    #c=[[0 for i in range(k)] for j in range(n)]
    #ans=0


t=int(input())
for _ in range(t):
    #n=int(input())
    n,m=map(int,input().split())
    if (n*m)%2==0:
        b=(n*m)//2+1
        w=(n*m)//2-1
    else:
        b=(n*m)//2+1
        w=(n*m)//2
    for i in range(n):
        for j in range(m):
            if i==0 and j==0:
                print('B',end="")
                b-=1
            elif i==0 and j==1:
                print('W',end="")
                w-=1
            else:
                if b>0:
                    b-=1
                    print('B',end="")
                else:
                    print('W',end="")
        print()
    #c=[[0 for i in range(k)] for j in range(n)]
    #ans=0


mp = lambda: map(int, input().split())
tc = lambda: int(input())
li = lambda: list(map(int, input().split()))
dp = lambda: [[0] * 10 for _ in range(10)]

def solve():
    for i in range(tc()):
        n, m = mp()
        a = []
        a.append("AB")
        for i in range(n - 1):
            a.append("B" * m)
        for i in range(len(a)):
            print(a[i])
solve()


mp = lambda: map(int, input().split())
tc = lambda: int(input())
li = lambda: list(map(int, input().split()))
dp = lambda: [[0] * 10 for _ in range(10)]

def solve():
    for i in range(tc()):
        n, m = mp()
        a = []
        str = "W"
        str += "B"*(m-1)
        a.append(str)
        for i in range(n - 1):
            a.append("B" * m)
        for i in range(len(a)):
            print(a[i])
solve()


mp = lambda: map(int, input().split())
tc = lambda: int(input())
li = lambda: list(map(int, input().split()))
dp = lambda: [[0] * 10 for _ in range(10)]

def solve():
    for i in range(tc()):
        n, m = mp()
        a = []
        a.append("WB")
        for i in range(n - 1):
            a.append("B" * m)
        for i in range(len(a)):
            print(a[i])
solve()


for i in range(int(input())):
        r,c=[int(i) for i in input().split()]
        ans=[[] for i in range(r)]
        for i in range(r):
                for j in range(c):
                        if (i+j)%2==0:
                                ans[i]+=['B']
                        else:
                                ans[i]+=['W']
        if (r*c)%2==0:
                ans[-1][-1]=ans[-1][-2]
        for i in range(r):
                for j in range(c):
                        print(ans[i][j],end='')
                print()


for i in range(int(input())):
        r,c=[int(i) for i in input().split()]
        ans=[[] for i in range(r)]
        for i in range(r):
                for j in range(c):
                        if (i+j)%2==0:
                                ans[i]+=['B']
                        else:
                                ans[i]+=['W']
        if (r*c)%2==0:
                ans[-1][-1]=ans[-1][-2]
        for i in range(r):
                for j in range(c):
                        print(ans[i][j],end=' ')
                print()


for i in range(int(input())):
        r,c=[int(i) for i in input().split()]
        ans=[[] for i in range(r)]
        for i in range(r):
                for j in range(c):
                        if (i+j)%2==0:
                                ans[i]+=['B']
                        else:
                                ans[i]+=['W']
        if (r*c)%2==0:
                ans[0][1]='B'
        for i in range(r):
                for j in range(c):
                        print(ans[i][j],end='')
                print()


from sys import stdin

t = int(input())
for _ in range(t):
	r, c = map(int, stdin.readline().split())
	result = []
	if c >= 3:
		for i in range(r - 1):
			result.append('B' + 'W'*(c - 1))
		result.append('BB' + 'W'*(c - 2))
	elif c == 2:
		result.append('BW')
		result.append('BB')
		for i in range(r - 2):
			if i % 2 == 0:
				result.append('BW')
			else:
				result.append('WB')
	for j in result:
		print (j)


from sys import stdin

t = int(input())
for _ in range(t):
	r, c = map(int, stdin.readline().split())
	result = []
	if c >= 3:
		for i in range(r - 1):
			result.append('B' + 'W'*(c - 1))
		result.append('BB' + 'W'*(c - 2))
	elif c == 2:
		result.append('BW')
		result.append('BB')
		for i in range(r - 1):
			if i % 2 == 0:
				result.append('BW')
			else:
				result.append('WB')
	for j in result:
		print (j)


from sys import stdin

t = int(input())
for _ in range(t):
	r, c = map(int, stdin.readline().split())
	result = []
	result.append('W' + 'B'*(c - 1))
	for i in range(r - 1):
		result.append('W'*c)
	for i in result:
		print (i)


from sys import stdin

t = int(input())
for _ in range(t):
	r, c = map(int, stdin.readline().split())
	result = []
	result.append('W' + 'B'*(c - 1))
	for i in range(r - 1):
		result.append('B'*c)
	for i in result:
		print (i)


def solve(n, m):
    this = ('bw' * m)[:m]
    that = ('wb' * m)[:m]
    result = [this if i % 2 == 0 else that for i in range(n)]
    if (n * m) % 2 == 0:
        result[0] = result[0].replace('w', 'b', 1)
    print(*result, sep='\n')

def main():
    t = int(input())
    for i in range(t):
        n, m = [int(x) for x in input().split()]
        solve(n, m)

if __name__ == '__main__':
    main()


def solve(n, m):
    this = ('BW' * m)[:m]
    that = ('WB' * m)[:m]
    result = [this if i % 2 == 0 else that for i in range(n)]
    if (n * m) % 2 == 0:
        result[0] = result[0].replace('W', 'B', 1)
    print(*result, sep='\n')

def main():
    t = int(input())
    for i in range(t):
        n, m = [int(x) for x in input().split()]
        solve(n, m)

if __name__ == '__main__':
    main()


def solve(n, m):
    result = [('bw' * m)[:m] for _ in range(n)]
    result[0] = result[0].replace('w', 'b', 1)
    print(*result, sep='\n')

def main():
    t = int(input())
    for i in range(t):
        n, m = [int(x) for x in input().split()]
        solve(n, m)

if __name__ == '__main__':
    main()


for _ in range(int(input())):
    n,m=map(int,input().split())
    s="B"*m
    for i in range(n):
        if i==0:
            print("W",end="")
            print(s[1:m])
        else:
            print(s)


for _ in range(int(input())):
    n,m=map(int,input().split())
    w=(n*m-1)//2
    b=n*m-w
    s=""
    for i in range(n):
        if w!=0:
            for j in range(m):
                if i%2==0:
                    if j%2==0:
                        s+="B"
                    else:
                        s+="W"
                    w-=m//2
                else:
                    if j%2==0:
                        s+="W"
                    else:
                        s+="B"
                    w=w-(m-m//2)
        else:
            s+="B"*m
    for i in range(n):
        print(s[i:i+m])
        i=i+m


t=int(input())
for _ in range(t):
    n,x=map(int,input().split(" "))
    a=list(map(int,input().split(" ")))
    a.sort(reverse=True)
    s=0
    t=[]
    count=0
    for y in range(n):
        s=s+1
        if a[y]*s>=x:
            count=count+1
            s=0
    print(count)


t=int(input())
for _ in range(t):
    n,m=list(map(int,input().split(" ")))
    ans=[[0 for _ in range(m)] for _ in range(n)]
    chk=1
    for x in range(m):
        for y in range(n):
            ans[y][x]='B'
    ans[n-1][m-1]='W'
    for x in ans:
        for y in x:
            print(y,end="")
        print()


for _ in range(int(input())):
    n,m = map(int, input().split())
    black = True
    for i in range(n):
        for j in range(m):
            if black:
                print('B',end='')
                if i==0 and j==0 and n*m%2==0:
                    pass
                else:
                    black = False
            else:
                print('W',end='')
                black = True
        print()
        if i==0 and n*m%2==0:
            black = True


for _ in range(int(input())):
    n,m = map(int, input().split())
    if n*m%2==1:
        black = True
        for i in range(n):
            for j in range(m):
                if black:
                    print('B',end='')
                    black = False
                else:
                    print('W',end='')
                    black = True
            print()
    else:
        black = True
        for i in range(n):
            for j in range(m):
                if black:
                    print('B',end='')
                    if not (i == 0 and j == 0):
                        black = False
                else:
                    print('W',end='')
                    black = True
            print()
            if i==0:
                black = True


t = int(input())
for i in range(0, t):
    y = input().split()
    n = int(y[0])
    m = int(y[1])
    start = False
    last = start
    boolean = False
    for j in range(0,n):
        if(last):
            start = False
        else:
            start = True
        op = ""
        last = start
        for l in range(0,m):
            if(start):
                op+="B"
                start = False
            else:
                op+="W"
                start = True

        if(not boolean and op[0] == "W" and n*m % 2 == 0):
            op = "B" + op[1:]
        elif j == n-1 and n*m % 2 == 0 and op[len(op) - 1] == "W" :
            op = op[0:len(op) - 1] + "B"
        print(op)
        boolean = True


t = int(input())
for i in range(0, t):
    y = input().split()
    n = int(y[0])
    m = int(y[1])
    start = True
    last = start
    boolean = False
    for j in range(0,n):
        if(last):
            start = False
        else:
            start = True
        op = ""
        last = start
        for l in range(0,m):
            if(start):
                op+="B"
                start = False
            else:
                op+="W"
                start = True

        if(not boolean and op[0] == "B" and n*m % 2 == 0):
            op = "W" + op[1:]
        elif j == n-1 and n*m % 2 == 0 and op[len(op) - 1] == "B" :
            op = op[0:len(op) - 1] + "W"
        print(op)
        boolean = True


t = int(input())
for i in range(0, t):
    y = input().split()
    n = int(y[0])
    m = int(y[1])
    start = False
    last = start
    boolean = False
    for j in range(0,n):
        if(last):
            start = False
        else:
            start = True
        op = ""
        last = start
        for l in range(0,m):
            if(start):
                op+="B"
                start = False
            else:
                op+="W"
                start = True

        if(not boolean and op[0] == "W" and n*m % 2 == 0):
            op = "B" + op[1:]
        elif j == n-1 and n*m % 2 == 0 and op[len(op) - 1] == "W" :
            op = op[0:len(op) - 1] + "B"
        elif j == n-1 and jtl[0] == "W" and op[len(op) - 1] == "W":
            op = op[0:len(op) - 1] + "B"
        elif j == n-1 and jtl[len(jtl ) - 1] == "W" and op[0] == "W":
            op = "B" + op[1:]
        if not boolean:
            jtl = op
        print(op)
        boolean = True


t = int(input())
for i in range(0, t):
    y = input().split()
    n = int(y[0])
    m = int(y[1])
    start = True
    op = ""
    for j in range(0,n):
        if(start):
            op+="B"
            start = False
        else:
            op+="W"
            start = True
    print(op)


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define eps 1e-9
#define all(a)   a.begin(),a.end()
#define mp make_pair
#define F first
#define S second
#define pb push_back
#define sz size()
#define rd(inp) scanf("%lld",&inp)
#define rd2(inp1, inp2) scanf("%lld %lld",&inp1, &inp2)
#define rl(inp) scanf("%d",&inp)
#define pf(out) printf("%lld\n", out);

const long long linf = 1e18+5;
const int mod = (int) 1e9 + 7;
const int inf = 1e9;

ll read(){
	bool minus = false;
	ll result = 0;
	char ch;
	ch = getchar();
	while (true) {
		if (ch == '-') break;
		if (ch >= '0' && ch <= '9') break;
		ch = getchar();
	}
	if (ch == '-') minus = true; else result = ch-'0';
	while (true) {
		ch = getchar();
		if (ch < '0' || ch > '9') break;
		result = result*10 + (ch - '0');
	}
	if (minus){
		return -result;
	}
	else{
		return result;
	}
}

ll fpow(ll base,ll power){
	ll result = 1;
	while (power > 0){
		if (power%2 == 1) result=(result*base);
  		base = (base*base);
  		power /= 2;
  	}
	return result;
}

#define maxn 200010

vector<ll> arr;
ll a[maxn], d[maxn], dp[maxn], par[maxn], n;
vector<pair<ll,ll> > adj[maxn];

void dfs(ll node){
	arr.pb(node);
	ll lo, hi, mid;
	lo = -1, hi = arr.sz - 1;
	ll ans = arr.sz - 1;
	while ( lo<=hi ){
		mid = (hi + lo) / 2;
		if ( d[node] - d[arr[mid]] <= a[node] ){
			ans = mid;
			hi = mid-1;
		}
		else lo = mid+1;
	}

	dp[par[node]] ++;
	dp[par[arr[ans]]] --;

	for ( ll j = 0 ; j < adj[node].sz ; j ++ ){
		d[adj[node][j].F] = d[node] + adj[node][j].S;
		dfs(adj[node][j].F);
	}
	arr.pop_back();
}

void go(ll v){
	for ( ll j = 0 ; j < adj[v].sz ; j ++ ){
		go(adj[v][j].F);
		dp[v] += dp[adj[v][j].F];
	}
}

int main(){
	n = read();
	ll i;
	for ( i = 1 ; i <= n ; i ++ ){
		a[i] = read();
	}
	for ( i = 2 ; i <= n ; i ++ ){
		ll p, w;
		p = read();
		w = read();
		adj[p].pb(mp(i, w));
		par[i] = p;
	}
	dfs(1);
	go(1);
	for ( i = 1 ; i <= n ; i ++ ) printf("%lld ", dp[i]);

	return 0;
}