# include <iostream>
using namespace std;
# include "partition.h"
//# include "grader.cpp"

const int MAX=(1<<20);

int n;
long long a[MAX];
long long sum[MAX];

std::vector<int> solve(std::vector<int> A)
{
    n=A.size();
    for(int i=0;i<n;i++) a[i]=A[i];

    sum[0]=0;
    for(int mask=1;mask<(1<<n);mask++)
    {
        int j=31-__builtin_clz(mask);
        sum[mask]=sum[mask^(1<<j)]+a[j];
    }

    long long S=sum[(1<<n)-1]/2;
    int bst=0;
    for(int mask=0;mask<(1<<n);mask++)
    {
        if(sum[mask]>S) continue;
        if(sum[bst]<sum[mask]) bst=mask;
    }

    vector<int> ans;
    for(int i=0;i<n;i++) if((bst&(1<<i))>0) ans.push_back(i);
    for(int i=0;i<n;i++) if((bst&(1<<i))==0) ans.push_back(i);
    return ans;
}
