
#include <bits/stdc++.h>
#include "partition.h"
//#include "grader.cpp"
using namespace std;

typedef long long ll;

vector<int> solve(vector<int> a) {

    int n = a.size();
    vector<int> b(n);
    iota(b.begin(), b.end(),0);

    sort(b.begin(), b.end(), [&](int x, int y) {
         return a[x] < a[y]; });

    vector<int> out;
    for(int r = n-1; r >= 0; r -= 2)
        out.push_back(b[r]);
    for(int r = n-2; r >= 0; r -= 2)
        out.push_back(b[r]);
//    cout << ans << '\n';
    return out;
}
