#include "partition.h"
#include <cstring>
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;

// #define int long long

std::vector<signed> solve(std::vector<signed> A) {
    vector <pair <int, int> > v;
    for (int i = 0; i < A.size(); i++) {
        v.emplace_back (A[i], i);
    }

    sort (v.begin(), v.end());
    vector <int> ans1;
    vector <int> ans2;
    for (int i = 0; i < v.size(); i += 2) {
        ans1.emplace_back (v[i].second);
        ans2.emplace_back (v[i + 1].second);
    }
    vector <int> ans;
    for (auto&& e : ans1)   
        ans.emplace_back (e);
    for (auto&& e : ans2)   
        ans.emplace_back (e);
    return ans;
}
