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

#define f first
#define s second

void _flush() {
        cout << endl;
        cout.flush();
}

int main() {
        cin.tie(0)->sync_with_stdio(0);
        
        int test; cin >> test;
        while (test--) {
                int n; cin >> n;
                int a[n + 1];
                memset(a, -1, sizeof(a));
                
                vector< pair<int, int> > v;
                int i = 2;
                while (i <= n) {
                        cout << "? 1 " << i - 1 << " " << i << " " << n - 1; _flush();
                        int x; cin >> x;
                        
                        v.push_back({x, i - 1});
                        if (x == n) break;
                        
                        if (i + 2 > n) i++;
                        else i += 2;
                }
                
                int u = -1;
                if (v.back().f == n) {
                        int x, k;
                        if (v.back().s == 1) k = 3;
                        else k = v.back().s;
                        
                        int t = 0;
                        for (int i = -1; i < 2; i += 2) {
                                cout << "? 1 " << k << " " << k + i << " " << n - 1; _flush();
                                cin >> x; t += x;
                                
                                k--;
                        }
                        
                        k++;
                        if (v.back().s > 1) k++;
                        if (t == 2 * n - 1) u = k;
                        else u = v.back().s * 2 + 1 - k;
                }
                else {
                        for (auto& k: v) {
                                if (k.f == n - 1) {
                                        cout << "? 1 " << k.s + 1 << " " << k.s << " " << n - 1; _flush();
                                        int x; cin >> x;
                                        
                                        if (x == n) {
                                                u = k.s; break;
                                        }
                                }
                        }
                }
                
                a[u] = n;
                
                for (int i = 1; i <= n; i++) {
                        if (i == u) continue;
                        cout << "? 2 " << i << " " << u << " 1"; _flush();
                        
                        int x; cin >> x; a[i] = x;
                }
                
                cout << "! ";
                for (int i = 1; i <= n; i++) cout << a[i] << " ";
                _flush();
        }
}