#include <bits/stdc++.h>
#include "partition.h"
//#include "grader.cpp"


using namespace std;

vector<int> solve(vector<int> a) {

    vector<int> b(n);
    iota(b.begin(), b.end(), 0);
//    vector<vector<int>> ch(30);
//    for(int i = 0; i < a.size(); i ++ ) {
//        ch[__lg(a[i])].push_back(i);
//    }
//
//    for(int i = 0; i < 30; i ++ ) {
//        for(int &x : ch[i])b.push_back(x);
//    }

    int n = a.size();
    vector<int> out;
    for(int r = 0 + (n%2==0); r < n; r += 2)
        out.push_back(b[r]);

    for(int r = n-2; r >= 0; r -= 2)
        out.push_back(b[r]);

    return out;
}
