#include <bits/stdc++.h>
using namespace std;
template <typename T>
void write(vector<T> &a) {
  for (auto it = a.begin(); it != a.end(); it++) cout << *it << " ";
  cout << endl;
}
void random(long long int a, long long int b, long long int n) {
  srand(time(0));
  for (long long int i = 0; i < n; i++) cout << rand() % b + a << " ";
  cout << endl;
}
long long int max(long long int a, long long int b) { return (a > b) ? a : b; }
long long int min(long long int a, long long int b) { return (a < b) ? a : b; }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(15);
  {
    long long int t;
    cin >> t;
    while (t--) {
      long long int n, m;
      cin >> n >> m;
      vector<string> ans(n);
      if ((n * m) % 2) {
        long long int x = 1;
        for (long long int i = 0; i < n; i++) {
          for (long long int j = 0; j < m; j++) {
            if (x)
              ans[i] += 'B';
            else
              ans[i] += 'W';
            x = !x;
          }
        }
      } else {
        long long int x = 1;
        for (long long int i = 0; i < m - 1; i++) {
          for (long long int j = 0; j < n; j++) {
            if (x)
              ans[j] += 'B';
            else
              ans[j] += 'W';
            x = !x;
          }
        }
        long long int i = 0, end = n;
        if (x) {
          ans[0] += 'B';
          i = 1;
        } else
          end = n - 1;
        for (; i < end; i++) {
          if (x)
            ans[i] += 'B';
          else
            ans[i] += 'W';
          x = !x;
        }
        if (i < n) ans[i] += 'B';
      }
      for (auto line : ans) cout << line << endl;
    }
  }
  return 0;
}
