#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 100009;
int T, n, p[N];
int read()
{
	int x;
	scanf("%d", &x);
	return x;
}
int findfirst()
{
	int l = 1, r = n-1, ans = n;
	while(l<=r)
	{
		int mid = l + r >> 1;
		printf("? 2 %d %d %d\n", 1, 2, mid);
		fflush(stdout);
		int x = read();
		if(x==mid)
			ans = mid, r = mid - 1;
		else l = mid + 1;
	}
	return ans;
}
int main()
{
// #ifndef ONLINE_JUDGE
// 	freopen("input.in", "r", stdin);
// 	freopen("output.out", "w", stdout);
// #endif
	T = read();
	while(T--)
	{
		n = read();
		p[1] = findfirst();
		for(int i = 2; i <= n; i++)
		{
			if(p[1]>n/2)
			{
				printf("? 2 %d %d %d\n", i, 1, 1);
				fflush(stdout);
				int x = read();
				if(x!=p[1]) p[i] = x;
				else
				{
					printf("? 1 %d %d %d\n", 1, i, n-1);
					fflush(stdout);
					x = read();
					p[i] = x;
				}
			}
			else
			{
				printf("? 1 %d %d %d\n", 1, i, n-1);
				fflush(stdout);
				int x = read();
				if(x!=p[1]) p[i] = x;
				else
				{
					printf("? 2 %d %d %d\n", i, 1, 1);
					fflush(stdout);
					x = read();
					p[i] = x;
				}
			}
		}
		printf("! ");
		for(int i = 1; i <= n; i++)
			printf("%d ", p[i]);
		printf("\n");
		fflush(stdout);
	}
	return 0;
}