func_code_string: #include <bits/stdc++.h>   using namespace std;   void solve() {     long long int n, i, t, j, p, q, a, b, m;     cin >> t;     while (t--) {       cin >> n >> m;       string s[n];       bool ck = true;       ;       p = (n * m);       if (p % 2 == 0)         a = (p / 2) - 1;       else         a = p / 2;       for (i = 0; i < n; i++) {         for (j = 0; j < m; j++) {           if (!ck && a) {             s[i] +=  W ;             a--;             ck = true;             continue;           } else {             s[i] +=  B ;             ck = false;             continue;           }         }       }       if (p % 2 == 0) {         s[n - 2][m - 2] =  W ;         s[n - 2][m - 1] =  B ;       }       for (i = 0; i < n; i++) cout << s[i] << endl;     }     return;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     solve();     return 0;   }   