#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define X first
#define Y second

vector<int> answer(vector<pair<int,int> > &arr){
    int n = (int) arr.size()-1;
    vector<int> ans(n);
    for(int i =1; i<=n; ++i)
        ans[i-1] = arr[i].Y-1;
    return ans;
}

vector<int> solve(vector<int> A){
    int n = (int) A.size();
    vector<pair<int,int> > arr(n+1);
    ll S=0, sum=0;
    for(int i =0;i<n;++i){
        arr[i+1] = {A[i], i+1};
        S += A[i];
    }
    sort(arr.begin()+1, arr.end());
    // for(int i =0;i<=n;++i)printf("%d %d\n", arr[i].X, arr[i].Y);
    S = (S>>1) + (S % 2);
    for(int i =1; i<= n>>1;++i){
        sum += arr[i].X;
        if(sum >= S)return answer(arr);
    }
    int nc = (n>>1) + n%2;
    for(int i = n>>1; i>0;--i){
        sum += arr[i + nc].X - arr[i].X;
        swap(arr[i+nc], arr[i]);
        if(sum >=S)return answer(arr);
    }
    sort(arr.begin()+(n>>1)+1, arr.end(), greater<pair<int, int> >());
    return answer(arr);
}