#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
vector<int> solve(vector<int> A){
    int sum=0,id=0,s=0;
    vector<int>ans,marked(1000005,false);
    vector<pair<int,int>>v;
    for(int i=0;i<A.size();++i){
        sum+=A[i];
        v.push_back({A[i],i});
    }
    if(sum%2==0){
        id=sum/2;
    }else id=sum/2+1;
    sort(v.begin(),v.end(),[](pair<int,int>a,pair<int,int>b){
         return a.first>b.first;
    });
    ///caut cea mai apropiata
    for(int i=0;i<v.size();++i){
        if(s+v[i].first<=id){
            s+=v[i].first;
            marked[v[i].second]=true;
            ans.push_back(v[i].second);
        }else if(s>=id)break;
    }
    for(int i=0;i<A.size();++i){
        if(marked[v[i].second]==false){
            ans.push_back(v[i].second);
        }
    }
    return ans;
}