#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    char a[n][m];
    memset(a, 'W', sizeof(a));
    for (int j = 0; j < m; j++) a[0][j] = 'B';
    for (int i = 0; i < n; i++) a[i][m - 1] = 'B';
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) cout << a[i][j];
      cout << endl;
    }
  }
  return 0;
}
