#include<iostream>
#include <map>
#include<vector>
using namespace std;
using ll = long long;


#include "partition.h"
std::vector<int> solve(std::vector<int> A) {
    vector<bool> used(A.size());
    map<int, bool> cnt;
    vector<int> res;
    ll sm = 0;
    for (int i = 0; i < A.size(); i++) {
        res.push_back(i);
        sm += A[i];
    }
    auto best = res;
    int diff = A.size();
    do {
        ll sum = 0;
        ll cnt = 0;
        for (auto i : res) {
            sum += A[i];
            cnt++;
            if (2 * sum >= sm) break;
        }
        if (abs((ll) cnt - (ll) (A.size() - cnt)) < diff) {
            best = res;
            diff = abs(cnt - (ll) (A.size() - cnt));
        }
    } while (next_permutation(res.begin(), res.end()));
    return best;
}


#ifndef EVAL
extern vector<int> solve(vector<int> A);
int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t ;
    for (int test=1; test<=t; test++) {
        int n;
        cin >> n ;
        vector <int> a(n);
        for (int i=0; i<n; i++) {
            cin >> a[i] ;
        }

        for (auto ind : solve(a)) {
            cout << ind << " ";
        }
        cout << endl ;
    }
    cout << endl ;
    return 0;
}
#endif
