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