#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);
    ll m = 0;
    int ffg = 0;
    int mn = 1e9;
    for(ll mask = 1; mask < (1ll<<n); ++mask){
        ll S = 0;
        int cnt = 0;
        ll minn = 1e9;
        int F = -1;
        for(int i = 0; i < n; ++i){
            if(mask & (1ll<<i)){
                ++cnt;
                S += a[i];
            }
        }
        for(int i = 0; i < n; ++i){
            if(mask & (1ll<<i)){
                if(S - a[i] < (sum+1)/2) F = i;
            }
        }
        if(S >= (sum+1)/2 and F != -1){
            if(abs(n - 2 * cnt) < mn){
                mn = abs(n - 2 * cnt);
                ffg = F;
                m = mask;
            }
        }
    }
    vector<int> b;
    for(int i = 0; i < n; ++i){
        if(m & (1ll<<i)){
            b.emplace_back(i);
        }
    }

    for(int i = 0; i < n; ++i){
        if(m & (1ll<<i) and i == ffg){
            swap(b[i],b[b.size()-1]);
        }
    }
    for(int i = 0; i < n; ++i){
        if(m & (1<<i)) continue;
        b.emplace_back(i);
    }

    return b;
}