#include "partition.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;

const int MAXN=1e5;

int c[MAXN];
int n;
bool v1[MAXN];
bool v2[MAXN];
int c1[MAXN];

vector<int> solve(vector<int> a)
{
    n=a.size();
    vector<int> ans;
    for(int i=0; i<n; i++)
    {
        c[a[i]]++;
    }
    for(int i=0; i<n; i++)
    {
        if(c1[a[i]]>=c[a[i]]/2)
        {
            continue;
        }
        ans.push_back(i);
        v1[i]=1;
        c1[a[i]]++;
    }
    for(int i=0; i<n; i++)
    {
        if(v1[i])
        {
            continue;
        }
        if(c1[a[i]]>=c[a[i]])
        {
            continue;
        }
        ans.push_back(i);
        v1[i]=1;
        c1[a[i]]++;
    }
    return ans;
}
