#ifndef __APPLE__
#include <bits/stdc++.h>
#else
#include <iostream>
#include <vector>
#include <set>
#include "random"
#include "map"
#include "iomanip"
#include "cassert"
#endif

using namespace std;

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define int long long

const int mod = 1000000007;

int dx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
map<pair<int, int>, int> col; // 1 mean white, 2 mean black
vector<pair<int, int>> ney;
int col_now;
vector<pair<int, int>> dif_col;
vector<pair<int, int>> our_col_now;
map<pair<int, int>, bool> used;
int n;

set<pair<int, int>> w_ve;
set<pair<int, int>> b_ve;

set<pair<int, int>> next_to_work;

void que(int x, int y) {
    if (col[{x, y}] != 0)
        return;
    cout << "? " << x << " " << y << endl;
    char c;
    cin >> c;
    if (c == 'W')
        col[{x, y}] = 1;
    else {
        col[{x, y}] = 2;
    }
    //cout << col[{x, y}] << "---\n";
}

void dfs_where_we_know(int x, int y) {
    if (col_now != col[{x, y}]) {
        exit(1);
    }
    used[{x, y}] = true;
    our_col_now.emplace_back(x, y);
    for (int k = 0; k < 8; k++) {
        int x_ = x + dx[k];
        int y_ = y + dy[k];

        if (col[{x_, y_}] == col_now && used[{x_, y_}] == 0) {
            dfs_where_we_know(x_, y_);
        }
        if (col[{x_, y_}] == 0) {
            ney.emplace_back(x_, y_);
        }
    }
}

void relax(int x, int y) {
    bool cnt1 = 0;
    bool cnt2 = 0;

    for (int k = 0; k < 8; k++) {
        int x_ = x + dx[k];
        int y_ = y + dy[k];
        if (col[{x_, y_}] == 1)
            cnt1 = true;
        if (col[{x_, y_}] == 2)
            cnt2 = true;
    }
    if (cnt1 && cnt2 && col[{x, y}] == 0) {
        next_to_work.insert({x, y});
    }
}

void solve() {
    w_ve.clear();
    b_ve.clear();
    col.clear();
    next_to_work.clear();
    used.clear();


    int x1 = 0, y1 = 0;
    while (w_ve.empty() || b_ve.empty()) {
        que(x1, y1);
        if (col[{x1, y1}] == 1) {
            w_ve.insert({x1, y1});
        }
        else {
            b_ve.insert({x1, y1});
        }
        x1 += 1;
    }

    for (int k = 0; k < 8; k++) {
        int x_ = x1 + dx[k];
        int y_ = y1 + dy[k];
        relax(x_, y_);
    }

    while (w_ve.size() < n && b_ve.size() < n) {
        if (!next_to_work.empty()) {
            auto [x, y] = *next_to_work.begin();
            next_to_work.erase(next_to_work.begin());
            if (col[{x, y}] != 0)
                continue;

            que(x, y);
            if (col[{x, y}] == 1) {
                w_ve.insert({x, y});
            }
            else {
                b_ve.insert({x, y});
            }

            for (int k = 0; k < 8; k++) {
                int x_ = x + dx[k];
                int y_ = y + dy[k];
                relax(x_, y_);
            }
            continue;
        }

        auto [x, y] = *w_ve.begin();
        auto [x2, y2] = *b_ve.begin();
        if (x < x2) {
            b_ve.clear();
            x--;
            while (b_ve.empty()) {
                que(x, y);
                if (col[{x, y}] == 1) {
                    w_ve.insert({x, y});
                }
                else {
                    b_ve.insert({x, y});
                }
                x--;
            }
            auto [x3, y3] = *w_ve.begin();
            for (int k = 0; k < 8; k++) {
                int x_ = x3 + dx[k];
                int y_ = y3 + dy[k];
                relax(x_, y_);
            }
        }
        else {
            w_ve.clear();
            x = x2;
            y = y2;
            while (w_ve.empty()) {
                que(x, y);
                if (col[{x, y}] == 1) {
                    w_ve.insert({x, y});
                }
                else {
                    b_ve.insert({x, y});
                }
                x--;
            }
            auto [x3, y3] = *b_ve.begin();
            for (int k = 0; k < 8; k++) {
                int x_ = x3 + dx[k];
                int y_ = y3 + dy[k];
                relax(x_, y_);
            }
        }
    }

    if (w_ve.size() >= n) {
        cout << "! W ";
        our_col_now.clear();

        col_now = 1;
        dfs_where_we_know(w_ve.begin()->first, w_ve.begin()->second);

        for (int i = 0; i < n; i++)
            cout << our_col_now[i].first << " " << our_col_now[i].second << " ";
        cout << endl;
        return;
    }
    else {
        cout << "! B ";
        our_col_now.clear();

        col_now = 2;
        dfs_where_we_know(b_ve.begin()->first, b_ve.begin()->second);

        for (int i = 0; i < n; i++)
            cout << our_col_now[i].first << " " << our_col_now[i].second << " ";
        cout << endl;
        return;
    }



    return;

    //cout << "JOPA\n";
    used.clear();
    col.clear();
    ney.clear();
    dif_col.clear();
    our_col_now.clear();
    que(0, 0);
    col_now = col[{0, 0}];
    dfs_where_we_know(0, 0);

    while (our_col_now.size() < n) {
        while (!ney.empty()) {
            auto [x, y] = ney.back();
            ney.pop_back();
            if (col[{x, y}] != 0)
                continue;
            que(x, y);
            if (col[{x, y}] == col_now) {
                our_col_now.emplace_back(x, y);
                for (int k = 0; k < 8; k++) {
                    int x_ = x + dx[k];
                    int y_ = y + dy[k];
                    if (col[{x_, y_}] == 0) {
                        ney.emplace_back(x_,y_);
                    }
                    //if (col[{x_, y_}] == 3 - col_now)
                    //    dif_col.emplace_back(x_, y_);
                }
            }
            else {
                dif_col.emplace_back(x, y);
            }
            if (dif_col.size() >= n) {
                used.clear();
                auto [x1, y1] = dif_col.back();
                our_col_now.clear();
                col_now = 3 - col_now;
                dfs_where_we_know(x1, y1);
                cout << "! ";
                if (col_now == 1) {
                    cout << "W ";
                }
                else {
                    cout << "B ";
                }
                for (int i = 0; i < n; i++)
                    cout << our_col_now[i].first << " " << our_col_now[i].second << " ";
                cout << endl;
                return;
            }
            if (our_col_now.size() >= n)
                break;
        }
        if (our_col_now.size() >= n) {
            used.clear();
            auto [x, y] = our_col_now.back();
            our_col_now.clear();
            dfs_where_we_know(x, y);
            cout << "! ";
            if (col_now == 1) {
                cout << "W ";
            }
            else {
                cout << "B ";
            }
            for (int i = 0; i < n; i++)
                cout << our_col_now[i].first << " " << our_col_now[i].second << " ";
            cout << endl;
            return;
        }
        col_now = 3 - col_now;
        sort(dif_col.begin(), dif_col.end());
        auto [x, y] = dif_col.back();
        ney.clear();
        used.clear();
        dif_col.clear();
        our_col_now.clear();
        dfs_where_we_know(x, y);
        //cout << x << " " << y << " ------ \n";
        break;
    }
    used.clear();
    auto [x, y] = our_col_now.back();
    our_col_now.clear();
    dfs_where_we_know(x, y);
    cout << "! ";
    if (col_now == 1) {
        cout << "W ";
    }
    else {
        cout << "B ";
    }
    for (int i = 0; i < n; i++)
        cout << our_col_now[i].first << " " << our_col_now[i].second << " ";
    cout << endl;
}

signed main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);



    int t = 1;
    cin >> t >> n;
    while (t--)
        solve();
}

/*

*/