#include<bits/stdc++.h>
using namespace std;
int t; 
int a[1000100],n;
int getmax(int i,int j)
{
	int ans;
	cout<<"?"<<" "<<1<<" "<<i<<" "<<j<<" "<<n-1<<endl;
	cin>>ans;
	return ans;
}
int getmin(int i,int j)
{
	int ans;
	cout<<"?"<<" "<<2<<" "<<i<<" "<<j<<" "<<1<<endl;
	cin>>ans;
	return ans;
}
int zhan[1000010];
int main()
{
	cin>>t;
	while(t--)
	{
		cin>>n;
		int bj=0;
		for(int i=1;i<=n;i+=2)
		{
			if(i+1<=n)
			{
				int ans=getmin(i,i+1);
				if(ans==1)
				{
					bj=i;break;
				}
				if(ans==2)
				{
					ans=getmin(i+1,i);
					if(ans==1)
					{
						bj=i;break;
					}
				}
		    }
		}
		if(bj==0)bj=n;
		else
		{
			if(getmin(bj,bj+1)==1);
			else bj++;
		}
		for(int i=1;i<=n;i++)
		{
			if(i!=bj)
			{
				int ans=getmax(i,bj);
				if(ans==n-1)ans=max(getmax(bj,i),ans);
				zhan[i]=ans;
			}
		}
		zhan[bj]=1;
		cout<<"!";
		for(int i=1;i<=n;i++)
		cout<<" "<<zhan[i];
		cout<<endl;
	}
	return 0;
}
