#include "partition.h"
using namespace std;

vector<int> ans;
bool vis[30000001];

vector<int> solve(vector<int> A) {
    ans.resize(A.size());
    int i1 = 0, i2 = A.size() / 2;
    for (int i = 0; i < A.size(); i++) {
        if (vis[A[i]])
            ans[i2++] = i;
        else
            ans[i1++] = i;
        vis[A[i]] = !vis[A[i]];
    }
    return ans;
}
