#include<bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int, int>
using namespace std;
typedef long long ll;

const int N = 233333;

int a[N];

int query(int t, int i, int j, int x) {
    cout << "? " << t << " " << i << " " << j << " " << x << endl;
    int res;
    cin >> res;
    return res;
}

void Solve() {
    int n;
    cin >> n;
    int x, i, j, res, p;
    int mx = query(1, 1, 2, n - 1);
    mx = max(mx, query(1, 2, 1, n - 1));
    x = mx - 1;
    res = query(1, 1, 2, x);
    if(res == mx) p = 2;
    else p = 1;

    a[p] = mx;
    for(int i = 1; i <= n; ++i) {
        if(i == p) continue;
        if(mx > (n + 1) / 2) {
            res = query(2, i, p, 1);
            if(res < mx) {
                a[i] = res;
            } else {
                res = query(1, p, i, n - 1);
                a[i] = res;
            }
        } else {
            res = query(1, p, i, n - 1);
            if(res > mx) {
                a[i] = res;
            } else {
                res = query(2, i, p, 1);
                a[i] = res;
            }
        }
    }
    cout << "!";
    for(int i = 1; i <= n; ++i) {
        cout << " " << a[i];
    }
    cout << endl;

}

int main() {
    int T;
    cin >> T;
    while(T--) {
        Solve();
    }
}