#include<bits/stdc++.h>
using namespace std;

const int MAXN = 2e6+7;
int n, a[MAXN];

vector<int> solve(vector<int> A)
{
    n = A.size();
    int s = 0;
    for(int i = 0; i < n; i++)
    {
        a[i] = A[i];
        s += a[i];
    }
    s = s/2+(s%2);
    int nn = n/2+(n%2);
    vector<int> ans;
    for(int ii = nn; ii >= 1 && ans.empty(); ii--)
    {
        int sum = 0, maxi = 0;
        vector<int> curr;
        for(int i = ii+1; i <= n; i++) curr.push_back(0);
        for(int i = 1; i <= ii; i++) curr.push_back(1);
        do
        {
            for(int i = 0; i < n; i++)
            {
                if(curr[i])
                {
                    sum += a[i];
                    maxi = max(maxi, a[i]);
                }
            }
            if(sum >= s && maxi < s-sum)
            {
                for(int i = 0; i < n; i++)
                {
                    if(curr[i])
                    {
                        ans.push_back(i);
                    }
                }
                for(int i = 0; i < n; i++)
                {
                    if(!curr[i])
                    {
                        ans.push_back(i);
                    }
                }
                break;
            }
        }while(next_permutation(curr.begin(), curr.end()));
    }
    return ans;
}
