#include "partition.h"
#include "bits/stdc++.h"
using namespace std;

#define ll long long
vector<int>a;

ll get(vector<int>res){
      ll sum=0;
      for(int x:res) sum+=a[x];
      ll cur=0,cnt=0;
      for(int i=0;i<res.size();i++){
            cur+=res[i];
            cnt++;
            if(cur>=sum/2) break;
      }
      ll c1=cnt;
      ll c2=res.size()-cnt;
      return abs(c1-c2);
}

vector<int>solve(vector<int>A)
{
      a=A;
      int n=A.size();
      vector<pair<ll,vector<int>>>all;
      for(int bit=0;bit<(1<<n);bit++){
            vector<int>v1,v2;
            for(int i=0;i<n;i++){
                  if((1<<i)&bit) v1.push_back(i);
                  else v2.push_back(i);
            }
            vector<int>res;
            for(int x:v1) res.push_back(x);
            for(int x:v2) res.push_back(x);
            all.push_back({get(res),res});
      }
      sort(all.begin(),all.end());
      return all[0].second;
}
