#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 pair<int,int> pi;
typedef vector<vi> vvi;
typedef long long ll;

int n;
mt19937 rng(time(0));
map<pi,int> cols;
// vector<pair<int,int>>nxtt = {{1,0}, {1,1}, {0,1}, {0,-1}, {-1,0}, {1,-1}, {-1,-1}, {-1,1}}; 
// vector<pair<int,int>>nxtt = {{0, -1}, {1, -1}, {-1, -1}, {-1, 0}, {1, 0}, {-1, 1}, {0, 1}, {1, 1}}; 
const vector<pair<int,int>>nxtt = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, -1}, {-1, -1}, {1, 1}, {-1, 1}}; 
int querycount=0;
int maxq=0;
int sumq=0;
set<pi> s[2] = {};

int check(pair<int,int>coords) {
    if(cols[coords]==0) {
        querycount++;
        sumq++;
        cout<<"? "<<coords.first<<' '<<coords.second<<endl;
        string c;cin>>c;
        if(c=="0") exit(0);
        if(c=="W")cols[coords]=1;
        else cols[coords]=2;
        // if(rng()%2)cols[coords]=1;
        // else cols[coords]=2;
        // if(cols[coords]==1)cout<<coords.first<<' '<<coords.second<<' '<<"W"<<endl;
        // else cout<<coords.first<<' '<<coords.second<<' '<<"B"<<endl;
    }
    auto res = cols[coords]-1;
    s[res].insert(coords);
    return res;
}

void solve() {
    s[0].clear();
    s[1].clear();
    cols.clear();
    querycount=0;
    check({0,0});

    while(s[0].size()<n and s[1].size()<n) {
        for(int j=0;j<2;++j) {
            bool fnd=0;
            for(auto p : s[j]) {
                for(auto nxt : nxtt) {
                    nxt.first+=p.first;
                    nxt.second+=p.second;
                    if(!cols.count(nxt)) {
                        fnd=1;
                        break;
                    }
                }
                if(fnd) break;
            }
            if(!fnd) s[j].clear();
        }
        pi use = {-1,-1};
        bool fnd=0;
        for(int j=0;j<2;++j) if(!fnd){
            for(auto p : s[j]) {
                for(auto nxt : nxtt) {
                    nxt.first+=p.first;
                    nxt.second+=p.second;
                    if(!cols.count(nxt)) {
                        if(s[!j].empty()) {
                            // great
                            use=nxt;
                            fnd=1;
                        } else {
                            for(auto to : nxtt) {
                                to.first+=nxt.first;
                                to.second+=nxt.second;
                                if(s[!j].count(to)) {
                                    use=nxt;
                                    fnd=1;
                                    break;
                                }
                            }
                        }
                    }
                }
                if(fnd) break;
            }
        }
        assert(fnd);
        check(use); // this automagically adds it to the set
    }
    if(s[0].size()>=n) {
        cout<<"! W";
        for(auto [x,y] : s[0]) {
            cout << ' ' << x << ' ' << y;
        }
        cout << endl;
    } else {
        cout<<"! B";
        for(auto [x,y] : s[1]) {
            cout << ' ' << x << ' ' << y;
        }
        cout << endl;
    }
    

}
int main(){
    cin.tie(0)->sync_with_stdio(0);
    int t;cin>>t>>n;
    while(t--)solve();
    // cout<<maxq<<endl;
    // cout<<sumq<<endl;
}