#include<bits/stdc++.h>
#include"partition.h"
using namespace std;
//#define int long long
void output(vector<int> a){
    for(auto x:a) cout<<x<<' ';
    cout<<'\n';
}
vector<int> solve(vector<int> A){
    int N=A.size();
    vector<pair<int,int>> v;
    for(int i=0;i<N;i++) v.emplace_back(A[i],i);
    sort(v.begin(),v.end());
    vector<int> res;
    for(int i=0;i<N/2;i++){
        res.push_back(v[i].second);
        res.push_back(v[N-i-1].second);
    }
    if(N%2==1) res.push_back(v[N/2].second);
    return res;
}