#include <bits/stdc++.h>

// meoowww mrrowww :3
// go play vivid/stasis!!! https://vividstasis.gay

#define fo(i, a, b) for (auto i = (a); i < (b); i++)
#define of(i, a, b) for (auto i = (b); i-- > (a);)
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define be(a) a.begin(), a.end()
using namespace std;

int ____init = []{
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    return 0;
}();

vector<int> solve(vector<int> a) {
    int n = a.size();
    
    vector<int> left, right;
    long long total_left = 0, total_right = 0, total_curr = 0;
    fo(i, 0, n) {
        total_curr += a[i];
        if (left.size() < right.size()) {
            left.pb(i), total_left += a[i];
        } else if (left.size() == right.size()) {
            if (total_left <= total_right) left.pb(i), total_left += a[i];
            else right.pb(i), total_right += a[i];
        } else {
            right.pb(i), total_right += a[i];
        }

        if (total_right * 2 >= total_curr) swap(left, right), swap(total_left, total_right);
    }

    vector<int> res;
    for (int i : left) res.pb(i);
    for (int i : right) res.pb(i);

    return res;
}