#include <bits/stdc++.h>
#define fi first
#define se second
#include "partition.h"

using namespace std;

bool Comp(pair <int,int> a,pair <int,int> b){
    return a.fi>b.fi;
}

std::vector<int> solve(std::vector<int> A){
    bool issubtask2 = 1;
    bool issubtask4 = 1;
    vector <int> ans;
    for (int i=0;i<n;++i){
        if (n>25 or A[i]!=(1<<i)) issubtask2 = 0;
        if (A[i]!=i+1) issubtask4 = 0;
    }
    if (issubtask2){
        for (int i=n-1;i>=0;--i) ans.push_back(i);
        return ans;
    }
    if (issubtask4){
        for (int i=0;i<n;++i){
            ans.push_back(i);
            if (ans.back()!=n-1-i) ans.push_back(n-1-i);
        }
        return ans;
    }
}