#include <bits/stdc++.h>
using namespace std;

vector<int> solve(vector<int> A){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int n = A.size();

    vector<pair<int, int>> valori(n+3);
    for(int i = 0; i < n; i++){
        valori[i].second = i;
        valori[i].first = A[i];
    }

    sort(valori.rbegin(), valori.rend());

    vector<int> ans;

    for(int i = 2; i < n; i+=2){
        ans.push_back(valori[i].second);
    }
    ans.push_back(valori[0].second);


    for(int i = 1; i < n; i+=2){
        ans.push_back(valori[i].second);
    }

    return ans;
}
