#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m, i, j;
    string s1, s2;
    cin >> n >> m;
    vector<string> v(n);
    for (i = 0; i < n; i++) {
      s1 = "";
      s2 = "";
      if (i % 2 == 0) {
        s2 = "BW";
      } else {
        s2 = "WB";
      }
      for (j = 0; j <= 50; j++) s1 += s2;
      v[i] = s1;
    }
    if ((n * m) % 2 == 0) {
      if (n % 2 == 0 && m % 2 == 1) {
        v[n - 1][m - 1] = 'B';
      } else
        v[0][m - 1] = 'B';
    }
    for (i = 0; i < n; i++) {
      cout << v[i].substr(0, m) << endl;
    }
  }
  return 0;
}
