#include "partition.h"
#include <bits/stdc++.h>

using namespace std;
const int N = 3e7+2;
int cnt[N];

std::vector<int> solve(std::vector<int> A) {
    int n = (int)A.size();
    vector<int> c, s;
    for (int i = 0; i < n; ++i) {
		if (!cnt[A[i]])c.push_back(i);
		else s.push_back(i);
		cnt[A[i]] ^= 1;
	}
	
	vector<int> res = c;
	for (auto i: s)res.push_back(i);
	return res;
}
