#include <bits/stdc++.h>
using namespace std;
using lng = long long;
#define vall(v) v.begin(), v.end()

vector <int> solve(vector<int>num) {
    lng as = 0, bs = 0, n = num.size();
    vector<int>ai, bi;
    sort(vall(num));
    for (lng i = 0; i < n; i++) {
        if (bs < as) {
            bs += num[i];
            bi.push_back(i);
        } else {
            as += num[i];
            ai.push_back(i);
        }
    }
    if (bs > as) {
        for (auto i : ai) bi.push_back(i);
        return bi;
    } else {
        for (auto i : bi) ai.push_back(i);
        return ai;
    }
}