#include <bits/stdc++.h>

using namespace std;

typedef int ll;
typedef vector<ll> v;
typedef vector<v> vv;
typedef vector<vv> vvv;
typedef pair<ll, ll> p;
typedef vector<p> vp;
typedef vector<vp> vvp;
typedef vector<vvp> vvvp;
typedef pair<ll, p> tri;
typedef vector<tri> vtri;
typedef vector<vtri> vvtri;
typedef vector<vvtri> vvvtri;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<vvb> vvvb;

#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()

const ll INF = 1e18;
const ll mod = 1e9 + 7;

std::vector<int> solve(std::vector<int> A)
{
    ll N = A.size();
    v perm;
    long long S = 0;
    for (ll i = 0; i < N; i++)
    {
        perm.pb(i);
        S += A[i];
    }
    //sort(all(nums));
    ll len = (N + 1) / 2;
    long long threshold = (S + 1) / 2;
    long long half = 0;
    for (ll i = 0; i < len; i++)
    {
        half += A[i];
    }
    ll i = len - 1, j = N - 1;
    while (half < threshold)
    {
        half += A[j] - A[i];
        swap(perm[i], perm[j]);
        i--; j--;
    }
    return perm;
}
/*
int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t ;
    for (int test=1; test<=t; test++) {
        int n;
        cin >> n ;
        vector <int> a(n);
        for (int i=0; i<n; i++) {
            cin >> a[i] ;
        }

        for (auto ind : solve(a)) {
            cout << ind << " ";
        }
        cout << endl ;
    }
    cout << endl ;
    return 0;
}
/**/