#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <iterator>
#include <cassert>
#include <queue>
#include "partition.h"
using namespace std;

#define dbg(x) cerr << #x << ' '; print(x); cerr << endl;
void print(int x) { cerr << x; }
void print(long long x) { cerr << x; }
void print(char x) { cerr << x; }
void print(string x) { cerr << x; }
void print(double x) { cerr << x; }
template <class T, class V> void print(pair <T, V> x);
template <class T> void print(vector <T> x) { cerr << "[ "; for (T i : x) { print(i); cerr << ' '; } cerr << ']'; }
template <class T> void print(set <T> x) { cerr << "[ "; for (T i : x) { print(i); cerr << ' '; } cerr << ']'; }
template <class T> void print(multiset <T> x) { cerr << "[ "; for (T i : x) { print(i); cerr << ' '; } cerr << ']'; }
template <class T, class V> void print(pair <T, V> x) { cerr << "{"; print(x.first); cerr << ' '; print(x.second); cerr << "}"; }

#define ll long long
#define OK cerr << "OK\n"
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define PII pair <int, int>
#define MP make_pair
#define inf 1e9 + 5
#define inf64 1e18 + 5;
#define pb push_back

int n;

vector<int> solve(vector<int> A) {
	int n = A.size();
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		sum += A[i];
	}
	sum = (sum + 1) / 2;
	ll curr = 0;
	vector <int> answ;
	for (int i = 0; i <= (n - 1) / 2; i++) {
		curr += A[i];
		if (curr >= sum) {
			for (int j = 0; j <= i; j++) answ.pb(j);
			for (int j = i + 1; j < n; j++) answ.pb(j);
			return answ;
		}
	}
	int i = (n - 1) / 2, j = n - 1;
	while (curr < sum) {
		curr -= A[i];
		curr += A[j];
		i--, j--;
	}
	for (int ii = 0; ii <= i; ii++) answ.pb(ii);
	for (int ii = j + 1; ii < n; ii++) answ.pb(ii);
	for (int ii = i + 1; ii <= (n - 1) / 2; ii++) answ.pb(ii);
	for (int ii = (n - 1) / 2 + 1; ii <= j; ii++) answ.pb(ii);
	return answ;
}