#include <bits/stdc++.h>

using namespace std;

const int N = (int)3e5 + 9;

long long ok(int x, vector < int > &a, vector < int > &c, long long &S) {
    vector < int > b;

    for (int i = x; i < (int)a.size(); i++) b.push_back(a[i]);
    for (int i = 0; i < x; i++) b.push_back(a[i]);

    long long su = 0, ind = 0;
    for (int i = 0; su < (S + 1) / 2; i++) su += c[b[i]], ind++;

    return (abs((int)a.size() - 2 * ind));
}

vector < int > solve(vector < int > c) {
    vector < int > a((int)c.size()); for (int i = 0; i < (int)c.size(); i++) a[i] = i;

    auto comp = [&](int i, int j) {
        return c[i] < c[j];
    };

    sort(a.begin(), a.end(), comp);

    long long mx = (int)1e18, n = (int)a.size(), S = accumulate(c.begin(), c.end(), 0ll), e = 0;
    vector < int > ans;

    for (int q = 0; q <= n + 1; q++) {
        if (mx >= ok(q, a, c, S)) {
            mx = min(mx, ok(q, a, c, S));
            e = q;
        } else break;
    }

    ans.clear();
    for (int i = e; i < n; i++) ans.push_back(a[i]);
    for (int i = 0; i < e; i++) ans.push_back(a[i]);

    return ans;
}