#include<bits/stdc++.h>
using namespace std;
int n;
int p[10010]; 

void solve()
{
	cin>>n;
	int j=0;
	for(int i=1;i<=n-1;i+=2)
	{
		cout.flush();
		cout<<"? "<<1<<" "<<i<<" "<<i+1<<" "<<n-1;
		cout<<endl;
		cout.flush();
		int a;
		cin>>a;
		if(a==n){
			p[i+1]=n;
			j=i+1;
			break;
		}
		if(a==n-1){
			cout.flush();
		    cout<<"? "<<1<<" "<<i+1<<" "<<i<<" "<<n-1;
		    cout<<endl;
		    cout.flush();
		    int a;
		    cin>>a;
		    if(a==n){
			    p[i]=n;
			    j=i;
			    break;
		    }  
		}	
	}
	if(j==0){
		p[n]=n;
		j=n;
	} 
	for(int i=1;i<=n;i++)
	{
		if(i==j) continue;
		cout.flush();
		cout<<"? "<<2<<" "<<i<<" "<<j<<" "<<1;
		cout<<endl;
		cout.flush();
		int a;
		cin>>a;
		p[i]=a;
	}
	cout.flush();
    cout<<"! ";
	for(int i=1;i<=n;i++)
	{
		cout<<p[i]<<" ";	
	}
	cout<<endl;
	cout.flush();
}

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		solve();
	}
} 
