#include <bits/stdc++.h>
#include "partition.h"

const int NMAX = 1e2;
const int SMAX = 4e4;

using namespace std;

int dp[NMAX + 5][SMAX + 5];
array<int, 3> bck[NMAX + 5][SMAX + 5];
int a[NMAX + 5], viz[NMAX + 5], n;

std::vector<int> solve(std::vector<int> A) {
    n = (int)A.size();
    for (int i = 1; i <= n; ++i)
        a[i] = A[i - 1];
    int64_t S = accumulate(a + 1, a + n + 1, 0LL);

    vector<int> best_p1;
    int best_dif = INT_MAX;
    for (int msk = 0; msk < (1LL << n); ++msk) {
        int sum = 0, cnt = 0;
        int total = __builtin_popcountll(msk);
        vector<int> aux;
        for (int i = 1; i <= n; ++i) {
            if ((msk & (1LL << (i - 1)))) {
                sum += a[i];
                ++cnt;
                aux.push_back(i);
            }
        }

        if (cnt != total) continue;
        int marisa = total;
        int deni = n - marisa;
        int dif = abs(marisa - deni);
        if (2 * sum >= S && dif < best_dif) {
            best_dif = dif;
            best_p1 = aux;
        }
    }

    fill(viz + 1, viz + n + 1, 0LL);
    vector<int> ans;
    for (auto &pos : best_p1) {
        viz[pos] = true;
        ans.push_back(pos - 1);
    }

    for (int i = 1; i <= n; ++i) {
        if (!viz[i])
            ans.push_back(i - 1);
    }

    return ans;
}

#ifndef EVAL
#include<iostream>
#include<vector>
using namespace std;
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