#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.second < b.second) {
    return 1;
  } else if (a.second == b.second) {
    if (a.first < b.first) {
      return 1;
    }
  }
  return 0;
}
vector<vector<int>> g;
vector<bool> used;
vector<int> lp;
queue<int> q;
int dfs(int from, int length = 0) {
  for (auto& to : g[from]) {
    if (length + 1 > lp[to]) {
      lp[to] = length + 1;
      dfs(to, length + 1);
    } else {
      continue;
    }
  }
  return 0;
}
void bfs(int start) {
  used[start] = true;
  q.push(start);
  while (!q.empty()) {
    int temp = q.front();
    q.pop();
    for (auto& to : g[temp]) {
      if (!used[to]) {
        q.push(to);
        used[to] = true;
      }
    }
  }
  return;
}
int main() {
  long long t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long n, m;
    cin >> n >> m;
    for (int j = 0; j < n - 1; j++) {
      for (int k = 0; k < m; k++) {
        cout << "B";
      }
      cout << endl;
    }
    cout << "W";
    for (int k = 1; k < m; k++) cout << "B";
    cout << endl;
  }
}
