#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 7;
vector<int> solve(vector<int> A) {
	vector<int>res;
	long long mn = INF;
	int cnt = 0;
	for(auto x : A){
		cnt += x;
	}
	if(cnt % 2 == 1){
		cnt += 1;
	}
	cnt /= 2;
	for(int mask = 0; mask < (1 << (int)A.size()); ++mask){
		vector<int>lol;
		int cnnn = 0;
		for(int i = 0; i < (int)A.size(); ++i){
			if(mask & (1 << i)){
				if(cnnn >= cnt){
					continue;
				}
				lol.push_back(i);
				cnnn += A[i];
			}
		}
		if(cnnn < cnt){
			continue;
		}
		int cn = (int)lol.size();
		int cnn = abs((int)A.size() - cn);
		cn = abs(cnn - cn);
		if(mn > cn){
			mn = cn;
			res = lol;
		}
		if(mn == 0){
			break;
		}
	}
	while((int)res.size() != (int)A.size()){
		res.push_back(0);
	}
	return res;
}
