#include "partition.h"
#include<bits/stdc++.h>
#define endl '\n'
#define out(x) #x<<" = "<<x<<" "
using namespace std;

const int MAX = 2 * 1e6 + 10;
vector<int> solve(vector<int> A) {
    vector<int> ans, ans1, ans2;
    vector<pair<int, int>> b;
    long long sum = 0, anss = 0;
    for(int i = 0; i < A.size(); i++){
        sum += A[i];
        b.push_back({A[i], i});
    }

    //sort(b.begin(), b.end());
    for(int i = 0; i < A.size(); i++){
        if(i %2 == 0){
            ans2.push_back(b[i].second);
            anss += b[i].first;
        }else ans1.push_back(b[i].second);
    }

    if(2 * anss >= sum){
        ans = ans2;
    }else{
        ans = ans1;
        ans1 = ans2;
    }

    for(int i: ans1){
        ans.push_back(i);
    }
    return ans;
}
