#include <bits/stdc++.h>
using namespace std;
vector <int> res,niz,m;
int N,k;
long long sum,s,t,rek;


vector <int> solve(vector<int> A){
    N=A.size();
    rek=N;
    res.clear();
    sum=0;

    int m[N];
    for(int i=0;i<N;i++){
        m[i]=i;
        sum+=A[i];
        res.push_back(0);
    }
    if(N>10) return res;
    do{
        s=0;
        for(int i=0;i<N;i++){
            s+=A[m[i]];
            t=i;
            if(s*2>=sum) break;

        }
        if(abs((t+1)-(N-t-1))<rek){ ///tj manja je abs razlika
            for(int i=0;i<N;i++){
                res[i]=m[i];
            }
            rek=abs((t+1)-(N-t-1));
        }
        if(rek==0){
            break;
        }



    }while(next_permutation(m,m+N));
    for(int i=0;i<N;i++){
        ///cout << res[i]<< " ";
    }
    ///cout << endl;

    return res;
}