#include <bits/stdc++.h>

using namespace std;

#include <bits/stdc++.h>

using namespace std;

std::vector<int> solve(std::vector<int> A)
{
    long long minn=10000000000000000;
    vector<int> res;
    long long sum=0;
    for(auto it : A)
        sum+=it;
        vector<int> vec;
        for(long long i=0;i<A.size();i++)
        {
            vec.push_back(i);
        }
        long long curr1=0;
        for(long long i=0;i<vec.size();i++)
        {
            curr1+=A[vec[i]];
            if(curr1>=sum/2+sum%2)
            {
                int br1=i+1;
                int br2=vec.size()-br1;
                if(abs(br1-br2)<minn)
                {
                    res=vec;
                    minn=abs(br1-br2);
                }

                break;

            }
        }

    while(next_permutation(vec.begin(),vec.end()))
    {
        long long curr=0;
        for(long long i=0;i<vec.size();i++)
        {
            curr+=A[vec[i]];
            if(curr>=sum/2+sum%2)
            {
                int br1=i+1;
                int br2=vec.size()-br1;
                if(abs(br1-br2)<minn)
                {
                    res=vec;
                    minn=abs(br1-br2);
                }

                break;

            }
        }

    }
    return res;
}

