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