#include <bits/stdc++.h>
using namespace std;
vector <int> ans, rep;
int br[300000007];
std::vector<int> solve(std::vector<int> A)
{
    ans.clear();
    rep.clear();
    for (int i = 0; i < A.size(); i++)
    {
        if (br[A[i]] % 2 == 0) ans.push_back(i);
        else rep.push_back(i);
        br[A[i]]++;
    }
    for (auto u : rep)
    {
        ans.push_back(u);
    }
    return ans;
}