#include <bits/stdc++.h>
using namespace std;

vector<int> solve(vector<int> A) {
    int s=0,s1=A.size();
    pair<int,int> m[s1];
    for(int i=0;i<s1;i++)
    {
        m[i]={A[i],i};
        s+=A[i];
    }

    sort(m,m+s1);

    vector<int>a,a1,a2;
    for(int i=0;i<s1;i+=2)
    {
        if(i==s1-1)
        {
            a1.push_back(m[i].second);
            continue;
        }
        if(m[i]>m[i+1])
        {
            a1.push_back(m[i].second);
            a2.push_back(m[i+1].second);
        }
        else
        {
            a1.push_back(m[i+1].second);
            a2.push_back(m[i].second);
        }
    }

    for(int i:a1)
    {
        a.push_back(i);
    }
    for(int i:a2)
    {
        a.push_back(i);
    }

    return {a};
}
