#include <bits/stdc++.h>
using namespace std;

#define endl '\n'
#define pb push_back
#define pii pair<int,int>
typedef long long ll;


std::vector<int> solve(std::vector<int> A)
{
    int n=A.size();
    vector<int> v1,v2;
    map<int,int> cnt;

    for (int i=0;i<n;i++)
    {
        if (cnt[A[i]]%2==0)v1.pb(i);
        else v2.pb(i);
        cnt[A[i]]++;
    }
    vector<int> v;
    for (auto x:v1)v.pb(x);
    for (auto x:v2)v.pb(x);
    return v;
}