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

vector<signed> solve(vector<signed> AA) {
    int n = AA.size();
    vector<pair<int, int>> a(n);
    int s = 0;
    for (int i = 0; i < n; ++i) {
        a[i] = {AA[i], i};
        s += a[i].first;
    }
    s = (s + 1) / 2;
    sort(a.begin(), a.end());
    int bstDf = 1000000000;
    vector<signed> bstPerm;
    int curS = 0;
    vector<signed> perm;
    for (int i = 0; i < n; ++i) {
        perm.push_back(a[i].second);
    }
    auto rate = [&](const vector<signed> &prm) {
        int sm = 0;
        for (int i = 0; i < n; ++i) {
            sm += AA[prm[i]];
            if (sm >= s) {
                return abs((n - i - 1) - (i + 1));
            }
        }
    };
    for (int sf = 0; sf < n; ++sf) {
        perm.insert(perm.begin(), perm.back());
        perm.pop_back();
        if (rate(perm) < bstDf) {
            bstDf = rate(perm);
            bstPerm = perm;
        }
    }
    return bstPerm;
}