#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long




std::vector<signed> solve(std::vector<signed> A) {
    int n = A.size();
    
    vector<signed> mv; int mn = 1e18;
    int s = 0; for (int i=0; i<n; i++) s+= A[i];
    for (int bt=0; bt<(1<<n); bt++){
        int sm = 0;
        vector<signed> nw;
        for (int i=0; i<n; i++){
            if (!((bt>>i)&1)) continue;
            sm+=A[i]; nw.push_back(i);
        }
        if (2*sm>= s && 2*sm-s < mn){
            mn = 2*sm-s; mv = nw;
        }
    }
    set<int> r; for (int x: mv) r.insert(x);
    for (int i=0; i<n; i++){
        if (!r.count(i)) mv.push_back(i);
    }
    return mv;
}
