
#include <bits/stdc++.h>
using namespace std;

#define int long long

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    int sm = 0;
    for(int &i : a) {
        cin >> i;
        sm += i;
    };

    vector<int> b(n);
    iota(b.begin(), b.end(),0);
    vector<int> v1, out;
    for(int r = n-1, l = 0,t = 0; l <= r; t ^= 1) {
        if(t) {
            v1.push_back(b[r--]);
        }else v1.push_back(b[l++]);
    }
    auto v2 = v1;
    reverse(v2.begin(), v2.end());
    int ans = n;
    auto chmax = [&](vector<int> ch) {
        int cur = 0, re = 0;
        for(int &i : ch) {
            cur += a[i];
            re ++ ;
            if(cur*2 >= sm)break;
        }
        int lo = abs(re - (n-re));
        if(ans > lo){
            ans = lo;
            out = ch;
        }
    };

    chmax(v1);
    chmax(v2);

//    cout << ans << '\n';
    for(auto &i : out)cout << i << ' ';
    cout << '\n';

};

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int tt = 1;
    cin >> tt;
    while(tt--)solve();
};
