#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int n, m;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    int countb = 0, countw = 0;
    char a[n][m];
    char c = 'B';
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0)
        c = 'B';
      else
        c = 'W';
      for (int j = 0; j < m; j++) {
        a[i][j] = c;
        if (c == 'W') {
          c = 'B';
          countw++;
        } else {
          c = 'W';
          countb++;
        }
      }
    }
    if (countw >= countb) {
      if (a[0][m - 1] == 'W') {
        a[0][m - 1] = 'B';
        countw--;
      }
    }
    if (countw >= countb) {
      if (a[n - 1][0] == 'W') {
        a[n - 1][0] = 'B';
        countw--;
      }
    }
    if (countw >= countb) {
      if (a[n - 1][m - 1] == 'W') {
        a[n - 1][m - 1] = 'B';
        countw--;
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cout << a[i][j];
      }
      cout << "\n";
    }
  }
  return 0;
}
