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

int main(){
	ios_base::sync_with_stdio(false), cin.tie(nullptr);
	int T;
	cin >> T;
	int N;
	cin >> N;
	while(T--){
		auto ask = [&](int x, int y){
			cout << "? " << x << ' ' << y << '\n';
			cout << flush;
			char c;
			cin >> c;
			return c;
		};
		int X = 1000;

		int bx = 0;
		int by = 0;
		while(true){
			vector<pair<int,int> > cells = {{bx, by}};
			char color = ask(bx, by);
			set<int> ny_list = {by-1, by, by+1};
			for(int d = bx+1; ; d++){
				if(ny_list.empty()) break;
				set<int> new_ny_list;
				for(int ny : ny_list){
					if(ask(d, ny) == color){
						cells.push_back({d, ny});
						new_ny_list.insert(ny-1);
						new_ny_list.insert(ny);
						new_ny_list.insert(ny+1);
					}
					if(cells.size() >= N) break;
				}
				if(cells.size() >= N) break;
				ny_list = new_ny_list;
			}
			if(cells.size() >= N){
				cout << "! " << color;
				for(auto [x, y] : cells){
					cout << ' ' << x << ' ' << y;
				}
				cout << '\n';
				cout << flush;
				break;
			}

			bx += X;
			if(bx >= int(1e6) - 2 * X){
				bx = 0;
				by += X;
			}
		}
	}
}
