#include<bits/stdc++.h>
using namespace std;

#define   fi(a,b) for(int i=a;i<b;i++)
#define   fj(a,b) for(int j=a;j<b;j++)
#define   ff first
#define   ss second
#define   ll long long
#define   ld long double
#define   ull unsigned long long
#define   bp(x) __builtin_popcount(x)
#define   pr(x) for(auto it: x) cout<<it<<" "; cout<<endl;
#define   getMax(x) max_element(x.begin(),x.end())
#define   getMin(x) min_element(x.begin(),x.end())
#define   endl "\n"
typedef   vector<int> vi;
typedef   vector< pair<int, int> > vii;
typedef   vector<long long> vl;
typedef   pair<int, int> pii;
typedef   pair<ll, ll> pll;
typedef   vector< pair<ll, ll> > vll;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// auto dist = uniform_int_distribution<int>(l, r);
// int dx[] = {1, 0, -1, 0};
// int dy[] = {0, 1, 0, -1};
// int dx[] = { -1, 0, 1, 1, 1, 0, -1, -1};
// int dy[] = { -1, -1, -1, 0, 1, 1, 1, 0};

ll query(ll t, ll i, ll j, ll x) {
    cout << "? " << t << " " << i << " " << j << " " << x << endl;
    ll temp;
    cin >> temp;
    if (temp == -1) exit(0);
    return temp;
}

void omae_wa_mou_shindeiru(int tc) {
    int n;
    cin >> n;
    vl ans(n + 1, -1);
    int ind_1 = -1, ind_n = -1, cnt2 = 0;
    for (int i = 1; i + 1 <= n; i += 2) {
        ll temp = query(2, i, i + 1, 1);
        if (temp == 2) {
            temp = query(2, i + 1, i, 1);
            if (temp == 1) {
                ind_1 = i + 1;
                break;
            }
        }
        else if (temp == 1) {
            if (i + 2 <= n) {
                temp = query(2, i, i + 2, 1);
                if (temp == 1) ind_1 = i;
                else ind_1 = i + 1;
            }
            else {
                temp = query(2, i, i - 1, 1);
                if (temp == 1) ind_1 = i;
                else ind_1 = i + 1;
            }
            break;
        }
    }
    if (ind_1 == -1) ind_1 = n;
    ans[ind_1] = 1;
    // cout << ind_1 << endl;

    for (int i = 1; i <= n; i++) {
        if (i == ind_1) continue;
        ll temp = query(1, i, ind_1, n - 1);
        if (temp == n - 1) {
            temp = query(1, ind_1, i, n - 1);
            ans[i] = temp;
        }
        else {
            ans[i] = temp;
        }
    }

    cout << "! ";
    fi(1, n + 1) cout << ans[i] << " ";
    cout << endl;

}

int main() {
    int tc = 1;
    cin >> tc;
    fi(1, tc + 1) {
        omae_wa_mou_shindeiru(i);
    }
}
