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

#define int long long
#define endl '\n'
#define pb push_back
#define sz(x) (x).size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fi first
#define se second

void solve() {
    int n;
    cin >> n;
    pair<int, int> a[n];
    int s = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i].fi;
        a[i].se = i;
        s += a[i].fi;
    }
    sort(a, a + n);
    int _ans[n];
    int ans = n + 1;
    do {
        int curs = 0;
        int k = 0;
        for (int i = 0; i < n; i++) {
            curs += a[i].fi;
            if (curs * 2 >= s) {
                k = i + 1;
                break;
            }
        }
        curs = abs(2 * k - n);
        if (curs < ans) {
            for (int i = 0; i < n; i++) {
                _ans[i] = a[i].se;
            }
            ans = curs;
//            cout << ans << endl;
        }
    } while (next_permutation(a, a + n));
    for (int i = 0; i < n; i++) {
        cout << _ans[i] << ' ';
    }
    cout << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr); cout.tie(nullptr);
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
