#include <bits/stdc++.h>
#define pii pair<int,int>
#define pb push_back

using namespace std;

const int nmax=2e6;

pii v[nmax+1];

vector<int>st,dr,answer;

vector<int> solve(vector<int>A){
    st.clear(),dr.clear();
    answer.clear();
    int n;
    n=A.size();
    for(int i=1;i<=n;i++){
        v[i].first=A[i-1];
        v[i].second=i;
    }
    sort(v+1,v+n+1);
    for(int i=1;i<=n;i++)
        if(i%2)
            st.pb(v[i].second-1);
        else dr.pb(v[i].second-1);
    for(int i:st)
        answer.pb(i);
    for(int i:dr)
        answer.pb(i);
    return answer;
}