#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define mp make_pair
#define ii pair<int, int>

using namespace std;

std::vector<int> solve(std::vector<int> A) {
    int n = A.size();
    vector<int> c(n);
    ll sum1 = 0;
    ll sum2 = 0;

    vector<ii> v;
    for (int i = 0; i < n; i++) {
        v.pb({A[i], i});
    }

    sort(v.begin(), v.end(), greater<>());

    int i = 0;
    int j = n-1;
    bool b = false;
    for ( auto [x, id] : v) {
        b = !b;
        if (b) {
            c[i] = id;
            i++;
        }
        else {
            c[j] = id;
            j--;
        }
        id++;
    }

    return c;
    //return {};
}