//#include "partition.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const int N = 2e6 + 1;

vector<int> solve(vector<int> a) {

    int n = (int)a.size();
    ll SUM = 0, sum = 0;
    for(int i = 0; i < n; i++) {
        SUM += a[i];
    }
    int sz = (n + 1) / 2;
    ll tar = SUM / 2;
    for(int i = n - 1; i >= sz; i--) SUM -= a[i];
    for(int i = sz - 1; i >= 0; i--) {
        if(SUM + sum > tar) {
            vector<int> res;
            for(int j = 0; j <= i; j++) {
                res.push_back(j);
            }
            int L = (n - (sz - (i + 1)));
            for(int j = L; j < n; j++) {
                res.push_back(j);
            }
            for(int j = i + 1; j < L; j++) {
                res.push_back(j);
            }
            return res;
        }
        sum += a[n - (sz - i)];
        SUM -= a[i];
    }
    vector<int> res;
    int L = (n - sz);
    for(int j = L; j < n; j++) {
        res.push_back(j);
    }
    for(int j = 0; j < L; j++) res.push_back(j);
    return res;


}
