#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;
	if (n & 1) {
		rep(i, 0, n - 1, 1) {
			if (i <= n / 2)ans[i] = ind[i * 2 + 1];
			else ans[i] = ind[i * 2];
		}
	}
	else {
		rep(i, 0, n - 1, 1) {
			if (i <= n / 2 - 1)ans[i] = ind[(i + 1) * 2];
			else ans[i] = ind[i * 2 + 1];
		}
	}
	return ans;
}