// Author: Vinay Khilwani
// Language: C++
 
// @vok8: Codeforces, AtCoder, LeetCode, HackerEarth, TopCoder, Google, FB, CSES, Spoj, GitHub, BinarySearch
// @vok_8: CodeChef, GFG
// @vok8_khilwani: HackerRank
 
// Never Stop Trying.
// Trying to be Better than Myself.
 
// while (true)
// {
//     if (AC)
//     {
//         break;
//     }
//     else if (Contest Over)
//     {
//         Try.
//         Check out Editorial.
//         Understand.
//         Find out your Mistake.
//         Learn the topic (if new).
//         Solve Problems on that topic (if new).
//         Upsolve that problem.
//         break;
//     }
//     else
//     {
//         Try.
//         Use Pen-Paper.
//         Find errors, edge cases, etc.
//         continue;
//     }
// }
 
// Optimizations
#pragma GCC optimize ("O2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("avx2")
#pragma GCC optimize ("Os")
 
// Libraries
#include <bits/stdc++.h>
using namespace std;
 
// Defines
#define fast ios_base::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL);
#define sz(a) int(a.size())
#define all(a) (a).begin(),(a).end()
#define pb push_back
using ll = long long int;
using ld = long double;
const ll mod = (ll) (1e9) + 7LL;
const ll M = 998244353LL;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const ld pi = acos(-1);

// Global Variable(s)

// Solver Function(s)
void solve()
{
    int n;
    cin >> n;
    vector<int> p(n);
    int ind = -1;
    for (int i = 1; i <= n; i += 2)
    {
    	if (i + 1 <= n)
    	{
    		cout << "? ";
	    	cout << 2 << " " << i << " " << i + 1 << " " << 1 << endl;
	    	int val;
	    	cin >> val;
	    	if (val == 1)
	    	{
	    		p[i - 1] = 1;
	    		ind = i - 1;
	    		break;
	    	}
	    	else if (val == 2)
	    	{
	    		cout << "? ";
	    		cout << 1 << " " << i << " " << i + 1 << " " << 1 << endl;
	    		cin >> val;
	    		if (val == 1)
	    		{
		    		p[i] = 1;
		    		ind = i;
		    		break;
		    	}
	    	}
	    }
    }
    if (ind == -1)
    {
    	ind = n - 1;
    }	
    p[ind] = 1;
    for (int i = 0; i < n; i++)
    {
    	if (i != ind)
    	{
    		cout << "? ";
    		cout << 1 << " " << ind + 1 << " " << i + 1 << " " << n - 1 << endl;
    		int val;
    		cin >> val;
    		p[i] = val;
    	}
    }
    cout << "! ";
    for (auto x : p)
    {	
    	cout << x << " ";
    }
    cout << endl;
}
 
// Main Function
int main()
{
    fast
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
} 