#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;

vector<int> solve(vector<int> A) {
	int N = A.size();
	vector<pair<int, int>> B;
	vector<int> v1, v2, ans;
	for (int i = 1; i < N; i++) {
		B.push_back({ A[i], i });
	}
	sort(B.begin(), B.end());
	int sum1 = 0, sum2 = 0;
	for (int i = B.size()-1; i >= 0; i--) {
		if (sum1 > sum2) {
			sum2 += B[i].first;
			v2.push_back(B[i].second);
		}
		else {
			sum1 += B[i].first;
			v1.push_back(B[i].second);
		}
	}
	if (sum1 > sum2) {
		for (auto i : v1) {
			ans.push_back(i);
		}
		for (auto i : v2) {
			ans.push_back(i);
		}
	}
	else {
		for (auto i : v2) {
			ans.push_back(i);
		}
		for (auto i : v1) {
			ans.push_back(i);
		}
	}
	return ans;
}
