#include <bits/stdc++.h>
using namespace std;
vector <int> res,niz,m;
int N,k;
long long sum,s,t,l,r,br;
bool uzet[50];
int maks,ind;

vector <int> solve(vector<int> A){
    N=A.size();

    res.clear();
    for(int i=0;i<N;i++){
        res.push_back(0);
    }
    br=0,l=0,r=N-1;
    t=N/4;
    for(int i=1;i<=t;i++){
        res[l]=br;
        res[r]=br+1;
        res[r-1]=br+2;
        res[l+1]=br+3;
        l+=2;
        r-=2;
        br+=4;
    }
    if(N%4==1){
        res[l]=br;
    }
    if(N%4==2){
        res[r]=br;
        res[r-1]=br+1;
    }
    if(N%4==3){
        res[l]=br;
        res[l+1]=br+2;
        res[l+2]=br+1;
    }

    for(int i=0;i<N;i++){
        ///cout << res[i]<< " ";
    }
    ///cout << endl;

    return res;
}