#include <vector>
using namespace std;

vector<bool> f(30000001);

vector<int> solve(vector<int> a){
    vector<int> sol[2];
    for (int i = 0; i < a.size(); i++){
        sol[f[a[i]]].push_back(i);
        f[a[i]] = !f[a[i]];
    }

    for (int i : sol[1]){
        sol[0].push_back(i);
    }

    return sol[0];
}
