#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

vector<int> solve(vector<int> A){
    vector<pair<int, int>> arr(A.size(), pair<int, int>());

    for(int i = 0; i<A.size(); i++){
        arr[i].first = A[i];
        arr[i].second = i;
    }

    sort(arr.begin(), arr.end());

    vector<int> ans;
    for(int i = 0; i<A.size(); i+=2) ans.push_back(arr[i].second);
    for(int i = 1; i<A.size(); i+=2) ans.push_back(arr[i].second);

    return ans;
}