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