#include "bits/stdc++.h"
#include "partition.h"
// #include "grader.cpp"
#define pb push_back
#define all(v) v.begin(), v.end()
#define ll long long
#define ff first
#define ss second
#define pii pair<int, int>
using namespace std;

vector<int> solve(vector<int> a){
    int n=(int)a.size();
    if(n<=3){
        vector<int> ans;
        for(int i = 0; i < n; ++i)
            ans.pb(i);
        return ans;
    }
    vector<int> ans;
    if(n&1){
        int lim=n/2-1;
        int l=0, r=n-1;
        int mid=(n+1)/2-1;
        while(l<=r)
            ans.pb(l), ans.pb(r), l+=2, r-=2;
        ans.pb(mid);
        l=1, r=n-2;
        while(l<=r){
            if(r-l==0)
                break;
            ans.pb(l), ans.pb(r), l+=2, r-=2;
        }
        return ans;
    }
    int l=0, r=n-1;
    while(l<=r){
        if(r-l==1)
            break;
        ans.pb(l), ans.pb(r), l+=2, r-=2;
    }
    ans.pb(r);
    ans.pb(l);
    l=1, r=n-2;
    while(l<=r)
        ans.pb(l), ans.pb(r), l+=2, r-=2;
    return ans;
}