#include "bits/stdc++.h"
using namespace std;

#define rep(i,a,b) for(int i = (a); i < (b); ++i)
#define all(x) begin(x),end(x)
#define sz(x) int(x.size())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;

int n;
map<pair<int,int>, int>cols;
map<pair<int,int>, int>tried;
vector<pair<int,int>>visited;
deque<pair<int,int>>bads;
mt19937 rng(time(0));

vector<pair<int,int>>nxtt = {{1,0}, {1,1}, {0,1}, {0,-1}, {-1,0}, {-1,-1}, {-1,1}, {1,-1}};
int querycount=0;
int maxq=0;
int check(pair<int,int>coords) {
    if(cols[coords]==0) {
        querycount++;
        cout<<"? "<<coords.first<<' '<<coords.second<<endl;
        string c;cin>>c;
        if(c=="W")cols[coords]=1;
        else cols[coords]=2;
        //if(rng()%2)cols[coords]=1;
        // if(cols[coords]==1)cout<<coords.first<<' '<<coords.second<<' '<<"W"<<endl;
        // else cout<<coords.first<<' '<<coords.second<<' '<<"B"<<endl;
    }
    return cols[coords];
}
void dfs(pair<int,int>coords) {
    visited.push_back(coords);
    tried[coords]=1;
    if(visited.size()>=n)return;
    for(auto nxt:nxtt) {
        pair<int,int> np = {nxt.first+coords.first, nxt.second+coords.second};
        if(tried[np]==0 && check(np)==check(coords)) {
            dfs(np);
            if(visited.size()>=n)return;
        } else if(tried[np]==0){
            bads.push_back(np);
        }
    }
}
void solve() {
    querycount=0;
    cols.clear();
    tried.clear();
    visited.clear();
    bads.clear();
    vector<pair<int,int>>cur;
    bads.push_back({0,0});
    for(int i=0;i<100000;i++) {
        visited.clear();
        auto p =bads.front();
        bads.pop_front();
        if(tried[p])continue;
        dfs(p);
        if(visited.size()>=n) {
            cout<<"! ";
            if(cols[visited[0]]==1)cout<<"W ";
            else cout<<"B ";
            for(int j=0;j<n;j++) {
                p=visited[j];
                cout<<p.first<<' '<<p.second<<' ';
            } 
            cout<<endl;
            // cout<<querycount<<endl;
            // cout<<endl;
            // maxq=max(maxq, querycount);
            return;
        }
    }
}
int main(){
    cin.tie(0)->sync_with_stdio(0);
    int t;cin>>t>>n;
    while(t--)solve();
    //cout<<maxq<<endl;
}