#include "partition.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;

const int MAXN=4*1e7;

int c[MAXN];
int n;
bool v1[MAXN];
bool v2[MAXN];
int c1[MAXN];
int x=0;
int y=0;

vector<int> solve(vector<int> a)
{
    n=a.size();
    vector<int> ans(n);
    vector<int> ans1;
    int k=n/2;
    for(int i=0; i<n; i++)
    {
        c[a[i]]++;
        if(c[a[i]]%2==0)
        {
            ans[x]=i;
            x++;
        }
        else
        {
            ans[k+y]=1;
            y++;
        }
    }
    return ans;
}
