#include<bits/stdc++.h>
using namespace std;
struct bag
{
    int v;
    int in;
};
bool cmp(bag a,bag b)
{
    return a.v>b.v;
}
vector<int>solve(vector<int>A)
{
    int n=A.size();
    vector<bag>a;
    for(int i=0;i<n;i++)
    {
        a.push_back({A[i],i});
    }
    sort(a.begin(),a.end(),cmp);
    vector<int>ans1,ans2;
    long long int s1=0,s2=0;
    for(int i=0;i<n;i++)
    {
        if(s2<s1)
        {
            s2+=a[i].v;
            ans2.push_back(a[i].in);
        }
        else
        {
            s1+=a[i].v;
            ans1.push_back(a[i].in);
        }
    }
    vector<int>ans;
    if(s1>=s2)
    {
        for(int i=0;i<ans1.size();i++)
        {
            ans.push_back(ans1[i]);
        }
        for(int i=0;i<ans2.size();i++)
        {
            ans.push_back(ans2[i]);
        }
    }
    else
    {
        for(int i=0;i<ans2.size();i++)
        {
            ans.push_back(ans1[i]);
        }
        for(int i=0;i<ans1.size();i++)
        {
            ans.push_back(ans2[i]);
        }
    }
    return ans;
}
/*
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;
}
*/