#include "partition.h"
#include <vector>
#include <utility>
#include<iostream>
#include<map>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<cmath>
#include<random>
using namespace std;
using ll = long long;
#define V vector
#define VI V<int>
#define rep(i,a,b,step) for(int i=int(a);i<=int(b);i+=int(step))
#define repl(i,a,b,step) for(int i=int(a);i>=int(b);i-=int(step))
#define ff first
#define ss second
#define pq priority_queue
mt19937 rd(time(nullptr));
std::vector<int> solve(std::vector<int> a) {
	int n = a.size();
	VI ans(n), ind(n + 1);
	rep(i, 0, n - 1, 1)ind[a[i]] = i;
    int l, r;
    if (n & 1) {
        l = 1;
        r = 2;
        rep(i, 0, n - 1, 1) {
            if (i <= n / 2)ans[i] = ind[l], l += 2;
            else ans[i] = ind[r], r += 2;
        }
	}
	else {
        l = 2;
        r = 1;
        rep(i, 0, n - 1, 1) {
            if (i <= n / 2 - 1)ans[i] = ind[l], l += 2;
            else ans[i] = ind[r], r += 2;
        }
	}
	return ans;
}