#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    int x = n * m;
    bool y = false;
    if (x % 2 == 0) y = true;
    int u = 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (u % 2 != 0 || (y && u == 2))
          cout << 'B';
        else
          cout << 'W';
        u++;
      }
      cout << endl;
    }
  }
  return 0;
}
