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

using namespace std;;
int s,h;
int n,a[100001];
std::vector<int> solve(std::vector<int> A)
{
    s=h=0;
    n=A.size();
    for(int i=0;i<n;i++)
        a[i]=A[i];

    for(int i=0;i<n;i++)
        h+=a[i];
    s=h;
    h=h/2+h%2;

    int ans=s,f=s;
    for(int i=0;i<(1<<n);i++)
    {
        int in=0;
        for(int j=0;j<n;j++)
        {
            if(i&(1<<j))
                in+=a[j];
        }

        if(in>=h)
            ans=min(ans,in);
            if(ans==in)f=i;
    }

    vector<int> v;

    for(int i=0;i<n;i++)
    {
        if((1<<i)&f)
        {
            v.push_back(i);
        }
    }
    for(int i=0;i<n;i++)
    {
        if((1<<i)&f);
        else v.push_back(i);
    }

    return v;
}


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;
}
