#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
void speed()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

const int maxn = 1e6 + 7;
int n;
pii a[maxn];
std::vector<int> solve(std::vector<int> A)
{
    n = A.size();
    for(int i = 0;i < n;i++)
    {
        a[i].X = A[i];
        a[i].Y = i;
    }
    sort(a, a + n);
    vector <int> ans, ans1, ans2;
    for(int i = 0;i < n;i += 2)
    {
        ans1.push_back(a[i].Y);
        ans2.push_back(a[i + 1].Y);
    }
    int j = 0;
    for(int i = 0;i < n;i += 2)
    {
        ans.push_back(ans1[j]);
        j++;
    }
    j = 0;
    for(int i = 0;i < n;i += 2)
    {
        ans.push_back(ans2[j]);
        j++;
    }
    return ans;
}
