#include "partition.h"
#include <bits/stdc++.h>

using namespace std;

#ifndef GIGO_DEBUG
#define cerr if(false)cerr
#endif // GIGO_DEBUG

vector<int> solve(vector<int> a) {
    int n = a.size();

    vector<pair<int, int>> pi;
    for(int i = 0; i < n; i++){
        pi.push_back({a[i], i});
    }
    sort(pi.begin(), pi.end());

    vector<int> ret;
    for(int i = 0; i < n; i+=2){ ret.push_back(pi[i].second); }
    for(int i = 1; i < n; i+=2){ ret.push_back(pi[i].second); }

    for(int i = 0; i < n; i++){
        cerr << ret[i] << (i!=n-1?' ':'\n');
    }

    return ret;
}
