#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second

extern vector<int> solve(vector<int> A) {

    map<ll,ll> mp;
    map<ll, bool> np;

    vector <ll> x;
    vector <ll> y;
    for (ll i=0; i<A.size(); i++) {
        mp[A[i]]++;
        np[i]=false;
        if (mp[A[i]]%2==1) {
            x.push_back(A[i]);
            y.push_back(i);
            np[i]=true;
        }
    }
    for (ll i=0; i<A.size(); i++) {
        if (np[i]==false) y.push_back(i);
    }

    return y;
}