#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
using namespace std;
#include "partition.h"

std::vector<int> solve(std::vector<int> a) {
	// BITMASK
	int S = 0;
	int n = (int)a.size();
	for (auto h : a){
		S += h;
	}
	
	int ans = 0, mi = S;
	for (int i = 0; i < (1 << n); i++){
		int sum = 0;
		for (int j = 0; j < n; j++){
			if ((1 << j) & i){
				sum += a[j];
			}
		}
		int diff = sum - S / 2;
		if (diff < 0){
			continue;
		}
		if (diff < mi){
			ans = i;
			mi = diff;
		}
	}
	
	vector<int> v;
	for (int j = 0; j < n; j++){
		if ((1 << j) & ans){
			v.pb(j);
		}
	}
	for (int j = 0; j < n; j++){
		if (((1 << j) & ans) == 0){
			v.pb(j);
		}
	}
	
	return v;
}
