#include <bits/stdc++.h>

#define pb push_back
#define fi first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 2e6 + 5;
const ll inf = 1e16;

bool taken[N];

vector<int> solve(vector<int> a) {
    vector<int> ans;
    int n = a.size();

    ll mindiff = inf;
    int bstmask = -1;
    for(int mask=0; mask<(1<<n); mask++) {
        ll s1 = 0, s0 = 0;
        for(int i=0; i<n; i++)
            if(mask & (1 << i))
                s1 += a[i];
            else
                s0 += a[i];
            
        if(s1 >= s0 && s1 - s0 < mindiff) {
            mindiff = s1 - s0;
            bstmask = mask;
        }
    }
    for(int i=0; i<n; i++)
        if(bstmask & (1 << i))
            ans.pb(i);
    for(int i=0; i<n; i++)
        if(!(bstmask & (1 << i)))
            ans.pb(i);

    return ans;
}

#ifndef EVAL
int32_t main() {
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
    cin.tie(nullptr)->sync_with_stdio(0);

    int tt;
    cin >> tt;
    while(tt--) {
        vector<int> a;
        int n;
        cin >> n;
        for(int i=1; i<=n; i++) {
            int x;
            cin >> x;
            a.pb(x);
        }

        vector<int> res = solve(a);
        for(auto x : res)
            cout << x << ' ';
        cout << '\n';
    }
    return 0;
}
#endif