#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define f first
#define se second
using namespace std;
 
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
 
int main() {
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
     ll t;
     //t=1;
     cin>>t;
     while(t--)
     {
         ll n;
         cin>>n;
         ll ind=-1;
         for(int i=1;i<n;i+=2)
         {
             
             cout<<"? 2 "<<i<<" "<<i+1<<" "<<1<<endl;
             ll x;
             cin>>x;
             if(x==1)
             {
                 ind=i;
                 break;
             }
             if(x==2)
             {
                 cout<<"? 2 "<<i+1<<" "<<i<<" "<<1<<endl;
                 ll xx;
                 cin>>xx;
                 if(xx==1)
                 {
                     ind=i+1;
                     break;
                 }
             }
             if(i+2==n)
             {
                 i--;
             }
         }
         ll ans[n+1];
         ans[ind]=1;
         for(int i=1;i<=n;i++)
         {
             if(i==ind)
             continue;
             cout<<"? 1 "<<ind<<" "<<i<<" "<<n-1<<endl;
             ll x;
             cin>>x;
             ans[i]=x;
         }
         cout<<"! ";
         for(int i=1;i<=n;i++)
         cout<<ans[i]<<" ";
         cout<<endl;
 
     }
}