#include <bits/stdc++.h>
using namespace std;
vector<int> solve(vector<int> A) {
    map<int, bool> mp;
    vector<int> a, b, ans;
    for (int i=0;i<A.size();i++) {
        if (mp[A[i]]==false) {
            a.push_back(i);
            mp[A[i]]=true;
        }else {
            b.push_back(i);
            mp[A[i]]=false;;
        }

    }
    for (int i=0;i<a.size();i++) {
        ans.push_back(a[i]);
    }
    for (int i=0;i<b.size();i++) {
        ans.push_back(b[i]);
    }
    return ans;
}
