#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
struct elem{
    int val, poz;
};
bool comp( elem a, elem b ){
    return a.val < b.val;
}
vector <int> ras;
vector <elem> a;
vector <int> solve( vector <int> v ){
    int i;
    a.clear();
    ras.clear();
    for( i = 0; i < v.size(); i++ ){
        a.push_back( { v[i], i } );
    }
    sort( a.begin(), a.end(), comp );
    for( i = 0; i < a.size(); i += 2 ){
        ras.push_back( a[i].poz );
    }
    for( i = a.size() - 1; i >= 0; i -= 2 ){
        ras.push_back( a[i].poz );
    }
    return ras;
}