#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vec;
const ll mod = 0;
const ll mx = 4294967295;
ll mul(ll x, ll y) { return (1ll * x * y); }
bool prime(ll x) {
  if (x < 2) return false;
  for (ll i = 2; i * i <= x; ++i) {
    if (x % i == 0) return false;
  }
  return true;
}
ll powerm(ll a, ll b, ll m = mod) {
  a %= m;
  ll res = 1 % m;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % m;
    }
    b >>= 1;
    a = (a * a) % m;
  }
  return res;
}
int solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i == n - 1 && j == m - 1)
        cout << 'W';
      else
        cout << 'B';
    }
    cout << endl;
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int q = 1;
  cin >> q;
  while (q--) solve();
}
