#include <iostream>
#include <vector>	
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#define pii pair<int,int>
using namespace std;
vector<bool>ans;
pii mn = { 1e7 + 7,0 };
void rec(vector<bool>used, int n,vector<int>a) {
	int sm1 = 0, sm2 = 0;
	for (int i = 0; i < n; i++) {
		if (used[i])sm1 += a[i];
		else sm2 += a[i];
	}
	if (abs(sm1 - sm2) <= mn.first) {
		mn = { abs(sm1 - sm2),sm1 >= sm2 };
		ans = used;
	}
	for (int i = 0; i < n; i++) {
		if (!used[i]) {
			used[i] = true;
			rec(used, n, a);
			used[i] = false;
		}
	}
	return;
}
vector<int> solve(vector<int>A) {
	vector<bool>used(A.size(), false);
	rec(used, A.size(), A);
	int n = A.size();
	vector<int>ans;
	for (int i = 0; i < n; i++) {
		if (used[i] == mn.second) {
			ans.push_back(i);
		}
	}
	for (int i = 0; i < n; i++) {
		if (used[i] != mn.second) {
			ans.push_back(i);
		}
	}
	return ans;
}
