#include<bits/stdc++.h>
#define int long long
#define MAXN 1010
using namespace std;
int T,n,a[MAXN][MAXN];
int query(int x,int y){
printf("? %lld %lld\n",x,y);fflush(stdout);
int w;scanf("%lld",&w);return w;
}
bool check(int x,int y){
printf("! %lld %lld\n",x,y);fflush(stdout);
int w;scanf("%lld",&w);return w==1;
}
void solve(int xl,int xr,int yl,int yr){//cerr<<"solve:"<<xl<<' '<<xr<<' '<<yl<<' '<<yr<<endl;
if(xl==xr&&yl==yr){assert(check(xl-1,yl-1));return;}
if(xr-xl>yr-yl){
int mid=(xl+xr)>>1;
for(int i=yl;i<yr;i++){
int now=query(mid,i);
a[mid][i]|=now;a[mid+1][i]|=now;
a[mid][i+1]|=now;a[mid+1][i+1]|=now;
}
int ls=0;//cerr<<'['<<xl<<','<<mid<<']'<<','<<'['<<yl<<','<<yr<<']'<<endl;
for(int i=xl;i<=mid;i++)
for(int j=yl;j<=yr;j++)ls^=(!a[i][j]);
/* for(int i=1;i<=n+1;i++){
for(int j=1;j<=n+1;j++)cerr<<a[i][j]<<' ';
cerr<<endl;
}*/
if(ls)solve(xl,mid,yl,yr);
else solve(mid+1,xr,yl,yr);
}else{
int mid=(yl+yr)>>1;
for(int i=xl;i<xr;i++){
int now=query(i,mid);
a[i][mid]|=now;a[i+1][mid]|=now;
a[i][mid+1]|=now;a[i+1][mid+1]|=now;
}
int ls=0;//cerr<<'['<<xl<<','<<xr<<']'<<','<<'['<<yl<<','<<mid<<']'<<endl;
for(int i=xl;i<=xr;i++)
for(int j=yl;j<=mid;j++)ls^=(!a[i][j]);
/* for(int i=1;i<=n+1;i++){
for(int j=1;j<=n+1;j++)cerr<<a[i][j]<<' ';
cerr<<endl;
}*/
if(ls)solve(xl,xr,yl,mid);
else solve(xl,xr,mid+1,yr);
}
}
signed main(){
scanf("%lld",&T);
while(T--){
scanf("%lld",&n);
for(int i=1;i<=n+1;i++)
for(int j=1;j<=n+1;j++)a[i][j]=0;
if(n&1){assert(check(-1,-1));continue;}
solve(1,n+1,1,n+1);
}
return 0;
}
/*#include<bits/stdc++.h>
#define int long long
#define MAXN 1010
using namespace std;
int T,n,a[MAXN][MAXN];
int query(int x,int y){
printf("? %lld %lld\n",x,y);fflush(stdout);
int w;scanf("%lld",&w);return w;
}
bool check(int x,int y){
printf("! %lld %lld\n",x,y);fflush(stdout);
int w;scanf("%lld",&w);return w==1;
}
void solve(int xl,int xr,int yl,int yr){//cerr<<"solve:"<<xl<<' '<<xr<<' '<<yl<<' '<<yr<<endl;
if(xl==xr&&yl==yr){assert(check(xl-1,yl-1));return;}
if(xr-xl>yr-yl){
int mid=(xl+xr)>>1;
for(int i=yl;i<yr;i++){
int now=query(mid,i);
a[mid][i]|=now;a[mid+1][i]|=now;
a[mid][i+1]|=now;a[mid+1][i+1]|=now;
}
int ls=0;//cerr<<'['<<xl<<','<<mid<<']'<<','<<'['<<yl<<','<<yr<<']'<<endl;
for(int i=xl;i<=mid;i++)
for(int j=yl;j<=yr;j++)ls^=(!a[i][j]);
/* for(int i=1;i<=n+1;i++){
for(int j=1;j<=n+1;j++)cerr<<a[i][j]<<' ';
cerr<<endl;
}*/
if(ls)solve(xl,mid,yl,yr);
else solve(mid+1,xr,yl,yr);
}else{
int mid=(yl+yr)>>1;
for(int i=xl;i<xr;i++){
int now=query(i,mid);
a[i][mid]|=now;a[i+1][mid]|=now;
a[i][mid+1]|=now;a[i+1][mid+1]|=now;
}
return 0;
}*/