#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    if ((n * m) % 2 > 0) {
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
          if (i % 2 == 0) {
            if (j % 2 == 0)
              cout << "B";
            else
              cout << "W";
          } else {
            if (j % 2 == 0)
              cout << "W";
            else
              cout << "B";
          }
        }
        cout << '\n';
      }
    } else if ((n * m) % 2 == 0) {
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
          if (i == n - 1 && j == m - 1 || i == n - 1 && j == m - 2) {
            cout << "B";
            continue;
          } else if (i % 2 == 0) {
            if (j % 2 == 0)
              cout << "B";
            else
              cout << "W";
          } else {
            if (j % 2 == 0)
              cout << "W";
            else
              cout << "B";
          }
        }
        cout << '\n';
      }
    }
  }
  return 0;
}
