#include <bits/stdc++.h>

using namespace std;

const long long inf = 1e18;

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

    int best = n;
    vector<int> ans;

    long long s = 0;
    for (int &val : a)
        s += val;

    vector<int> p(n);
    iota(p.begin(), p.end(), 0);

    do {
        long long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += a[p[i]];

            if (sum >= s / 2.0) {
                int d = abs(2 * (i + 1) - n);

                if (d < best) {
                    best = d;
                    ans = p;
                }

                break;
            }
        }
    } while (next_permutation(p.begin(), p.end()));

    return ans;
}