#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define nl '\n'
#define pob pop_back()
#define fi first
#define se second
#define pof pop_front()
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long,long long>
#define sz size()
#define vint vector <int>
#define vll vector<long long>
#define empty empty()
#define pop pop()
using namespace std;
const int NMAX = 200002;
int v[NMAX];
int main()
{
    cin.tie ( 0 )->sync_with_stdio ( 0 );
    cin.tie ( NULL );
    cout.tie ( NULL );
    int T = 1;
    cin >> T;

    while ( T-- )
    {
        ll n, m;
        cin >> n;

        for ( int i = 1; i <= n; i++ )
            v[i] = 0;

        int pozbun = 0;
        bool ok = 0;

        for ( int i = 1; i < n; i++ )
            if ( ok == 0 )
                for ( int j = i + 1; j <= n; j++ )
                {
                    cout << "? " << 2 << ' ' << i << ' ' << j << ' ' << 1 << nl;
                    cout.flush();
                    int nr;
                    cin >> nr;

                    if ( nr >= 2 )
                    {
                        ok = 1;
                        pozbun = i;
                        break;
                    }

                    cout << "? " << 2 << ' ' << j << ' ' << i << ' ' << 1 << nl;
                    cout.flush();
                    cin >> nr;

                    if ( nr >= 2 )
                    {
                        ok = 1;
                        pozbun = j;
                        break;
                    }
                }

        int pmn = 0;

        //cout<<pozbun<<nl;
        for ( int i = 2; i <= n; i += 2 )
        {
            cout << "? " << 2 << ' ' << i - 1 << ' ' << i << ' ' << 1 << nl;
            cout.flush();
            int nr;
            cin >> nr;

            if ( nr == 2 )
            {
                if ( pozbun != i )
                {
                    cout << "? " << 2 << ' ' << i << ' ' << pozbun << ' ' << 1 << nl;
                    cout.flush();
                    int nr2;
                    cin >> nr2;

                    if ( nr2 == 1 )
                    {
                        v[i] = 1;
                        pmn = i;
                        break;
                    }
                }
            }
            else
                if ( nr == 1 )
                {
                    pmn = i - 1;
                    v[i - 1] = 1;
                    break;
                }
        }
        if(pmn==0)
        {
            cout << "? " << 2 << ' ' << n - 1 << ' ' << n << ' ' << 1 << nl;
            cout.flush();
            int nr;
            cin >> nr;

            if ( nr == 2 )
            {
                if ( pozbun != n )
                {
                    cout << "? " << 2 << ' ' << n << ' ' << pozbun << ' ' << 1 << nl;
                    cout.flush();
                    int nr2;
                    cin >> nr2;

                    if ( nr2 == 1 )
                    {
                        v[n] = 1;
                        pmn = n;

                    }
                }
            }
            else
                if ( nr == 1 )
                {
                    pmn = n - 1;
                    v[n - 1] = 1;

                }
        }
        //cout<<pmn<<nl;
        for ( int i = 1; i <= n; i++ )
            if ( v[i] == 0 )
            {
                cout << "? " << 1 << ' ' << pmn << ' ' << i << ' ' << n - 1 << nl;
                cout.flush();
                int nrr;
                cin >> nrr;
                v[i] = nrr;
            }

        cout << "! ";

        for ( int i = 1; i <= n; i++ )
            cout << v[i] << ' ';

        cout << nl;
        cout.flush();
    }

    return 0;
}
