#include<bits/stdc++.h>
using namespace std;
using ll = long long;

vector<int> solve(vector<int> a){
    int n = a.size();
    ll sum = accumulate(a.begin(),a.end(),0ll);
    int m = 0;
    int mn = 1e9;
    for(int mask = 1; mask < (1ll<<n); ++mask){
        ll S = 0;
        int cnt = 0;
        int minn = 1e9;
        for(int i = 0; i < n; ++i){
            if(mask & (1<<i)){
                ++cnt;
                S += a[i];
                minn = min(minn, a[i]);
            }
        }
        if(S >= (sum+1)/2 and S - minn < (sum+1)/2){
            if(abs(n - 2 * cnt) < mn){
                mn = abs(n - 2 * cnt);
                m = mask;
            }
        }
    }
    vector<int> b;
    for(int i = 0; i < n; ++i){
        if(m & (1<<i)){
            b.emplace_back(i);
        }
    }
    for(int i = 0; i < n; ++i){
        if(m & (1<<i)) continue;
        b.emplace_back(i);
    }

    return b;
}