#include "partition.h"
#include <bits/stdc++.h>

using namespace  std;

const int maxn=1e5+10;
const int mod=1e9+7;


std::vector<int> solve(std::vector<int> A)
{
    int n=A.size();
    vector<int>ans;
    int sum=0;
    int dif=1e9;
    vector<pair<int,int>>a;
    for (int i=0;i<n;i++) {
        sum+=A[i];
        a.push_back({A[i],i});
    }
    sort(a.begin(),a.end());
    do {
        int s=0;
        int kol=0;
        for (int i=0;i<n;i++) {
            s+=a[i].first;
            kol++;
            if (s>(sum/2))break;
        }
        if (dif>abs(kol-n)) {
            dif=abs(kol-n);
            vector<int>a2;
            for (int i=0;i<n;i++) {
                a2.push_back(a[i].second);
            }
            ans=a2;
        }
    }while (next_permutation(a.begin(),a.end()));
    return ans;
}