#include <bits/stdc++.h>

using namespace std;

std::vector<int> solve(std::vector<int> A)
{
    long long minn=1000000000;
    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)
                break;
        }
        long long br23=sum-curr1;
        if(abs(br23-curr1)<minn)
        {
            minn=abs(br23-curr1);
            res=vec;
        }

    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)
                break;
        }
        long long br2=sum-curr;
        if(abs(br2-curr)<=minn)
        {
            minn=abs(br2-curr);
            res=vec;

        }
    }
    return res;
}