#include<bits/stdc++.h>

using namespace std;
#define for0(i, n)           for (int i = 0; i < (int)(n); i ++) //0 based indexing
#define print(x)             cout << (x ? "YES" : "NO") << endl

#define all(x)               x.begin(), x.end() 
#define rall(x)              (x).rbegin(), (x).rend() 
#define loop(x)              int x; cin >> x; while(x --)
#define int                  long long
#define pb                   push_back

class Solution{
    public :
        void fx(){
            int n, xx; 
            cin >> n;
            int arr[n];
            xx = GetN(n);
            arr[xx] = n;
            for0(i, n){
                if(i != xx){
                    cout << "? 2 " << i + 1 << " " << xx + 1 << " " << 1 <<endl;
                    
                    cin >> arr[i];
                } 
            }
            cout << "! ";
            for(auto x : arr) cout << x << " ";
            cout << endl;
        }
        static int GetN(int n){
            for(int i = 0; i < n - 1; i += 2){
                int x;
                cout << "? 1 " << i + 1 << " " << i + 2 <<" " << n - 1 << endl;
                
                cin >> x;
                if(x == n){
                    return(i + 1);
                }
                if(x == n - 1){
                    cout << "? 1 " << i + 2 << " " << i + 1 <<" " << n - 1 << endl;
                    
                    cin >> x;
                    if(x == n) return(i);
                }
            }
            return(n - 1);
        }
};

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    loop(x){
        Solution ob;
        ob.fx();
    }
    return 0;
}
