#include "partition.h"
#include <iostream>
#include <cassert>
#define pb push_back
std::vector<int> solve(std::vector<int> A) {
    int N = A.size();
    std::vector<int> rez(N);
    int val = 0;
    if((N & 1)){
        val = 1;
    }
    assert( N % 2);
    bool ok = false;
    for(int i = 0;i<N;i++){
        if((i & 1)){
            rez[i] = ((N - i + N - val) % N);
            if((N - i + N - val) % N == i && N % 2 == 0){
                rez[i - 1] = i + 1;
                rez[i + 1] = i - 1;
                ok = true;
            }
        }else{
            if(ok == false){
                rez[i] = i; // cele impare raman pe aceeasi pozitie
            }else{
                ok = false;
            }
        }

    }
    return {rez};
}
