#include <bits/stdc++.h>
#pragma GCC optimize "O3, unroll_loops"
#include "partition.h"

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 = 0 + (n%2==0); r < n; 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;
}
