#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<LL,LL> pii;
typedef pair<LL,pii> ppi;
typedef pair<pii,pii> ppp;
#define FOR(i, n) for(int i = 1; i<=n; i++)
#define F0R(i, n) for(int i = 0; i<n; i++)
#define mp make_pair
#define pb push_back
#define f first
#define s second

template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {cout << "["; F0R(i, v.size()) {if (i) cout << ", "; cout << v[i];} return cout << "]";}

//var 
LL T, n, ans[1000005];

LL query(LL t1, LL t2, LL t3, LL t4){
	cout << "? " << t1 << ' ' << t2 << " " << t3 << ' ' << t4 << endl;
	LL res; cin >> res;
	return res;
}

void determine(LL i, LL j){
	LL p1 = query(1, i, j, n-1);
	LL p2 = query(2, i, j, 1);

	if(p2 == 2)
		p2 = query(2, j, i, 1);
	
	if(p1 == n-1)
		p1 = query(1, j, i, n-1);

	//cout << p1 << " " << p2 << '\n';

	if(query(1, i, j, p2) == p2){
		ans[j] = p2;
		ans[i] = p1;
	}
	else{
		ans[i] = p2;
		ans[j] = p1;
	}

	//cout << i << ' ' << j << " " << ans[i] << ' ' << ans[j] << '\n';

}

void solve(){
	cin >> n;
	for(int i = 2; i<=n; i += 2)
		determine(i-1, i);
	
	if(n % 2) determine(n-1, n);

	cout << "! "; FOR(i, n) cout << ans[i] << ' ';
	cout << endl;
}

int main(){
	ios_base::sync_with_stdio(0); 
	cin.tie(0);

	T = 1;
	cin >> T;
	FOR(t, T)
		solve();

	cout.flush();
	return 0;
}