#include <iostream>
#include <vector>
using namespace std;
int n,t;
long long a[2000000];
vector <int> solve(vector <int> a) {
	vector <int>b(a.size());
	for (int i = a.size() - 2; i > 0; i -= 4) {
		b.push_back(i);
		b.push_back(i - 1);
	}
	b.push_back(a.size() - 1);
	for (int i = a.size() - 4; i > 0; i -= 4) {
		b.push_back(i);
		b.push_back(i - 1);
	}
	return b;
}
int main() {
	cin >> t;
	while (t--) {
		cin >> n;
		vector <int> a(n);
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		solve(a);
	}
}