#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e6 + 5;
const ll mod = 1e9 + 7;
int n, m, k, x;
int ans[N];

int main() {
    ios_base::sync_with_stdio(0);
    int T = 1;
    cin >> T;
    while(T--) {
        cin >> n;
        ll id = n;
        for(int i = 1;i < n;i += 2) {
            cout << "? " << 1 << ' ' << i << ' ' << i + 1 << ' ' << n - 1 << endl;
            cin >> x;
            if(x == n) {
                id = i + 1;
                break;
            }
            else if(x == n - 1) {
                cout << "? " << 1 << ' ' << i + 1 << ' ' << i << ' ' << n - 1 << endl;
                cin >> x;
                if(x == n) {
                    id = i;
                    break;
                }
            }
        }
        for(int i = 1;i <= n;i++) {
            if(i == id) ans[i] = n;
            else {
                cout << "? " << 2 << ' ' << i << ' ' << id << ' ' << 1 << endl;
                cin >> x;
                ans[i] = x;
            }
        }
        cout << "! ";
        for(int i = 1;i <= n;i++) {
            cout << ans[i] << " \n"[i == n];
        }
    }
}
/*
7
1 6 5 2 3 4 7
 */