#include <bits/stdc++.h>

using namespace std;

#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define pb push_back

void solve(){
    int n;
    cin >> n;

    vector <int> a(n);
    vector <pair<int,int> > b(n);

    for(int i = 0;i < n;i++){
        cin >> a[i];
        b[i].ff = a[i];
        b[i].ss = i;
    }

    sort(all(b));

    vector <int> ans;

    for(int i = 0;i < n;i += 2){
        ans.pb(b[i].ss);
    }
    for(int i = 1;i < n;i += 2){
        ans.pb(b[i].ss);
    }

    for(int i = 0;i < n;i++){
        cout<<ans[i] << ' ';
    }
    cout<<endl;
}

signed main(){
    int t;
    cin >> t;

    while(t--){
        solve();
    }
}
