#include <iostream>
#include <vector>	
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#define pii pair<int,int>
using namespace std;
vector<int> solve(vector<int>a) {
	vector<pii>a1;
	for (int i = 0; i < a.size(); i++) {
		a1.push_back({ a[i],i });
	}
	sort(a1.begin(), a1.end());
	vector<int>ans;
	for (int i = 0; i < a.size(); i+=2) {
		ans.push_back(a1[i].second);
	}
	for (int i = 1; i < a.size(); i += 2) {
		ans.push_back(a1[i].second);
	}
	return ans;
}
int main() {
	int tt;
	cin >> tt;
	while (tt--) {
		int n;
		cin >> n;
		vector<int>a(n);
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		solve(a);
	}
}