#include "partition.h"

using namespace std;
const int MAXN=2*1e6;
long long br[MAXN];
std::vector<int> solve(std::vector<int> a) 
{
    long long n=a.size();
    vector<int>ans;
    vector<int>ot;
    vector<int>otz;
    
    for(long long i=0;i<n;i++)
    {
        br[a[i]]++;
    }
    
    for(long long i=0;i<n;i++)
    {
        if(br[a[i]]%2==0)
        {
            ot.push_back(i);
        }
        else{
            otz.push_back(i);
        }
        br[a[i]] --;
    }
    ans=ot+otz;
    return ans;
}
