#include <bits/stdc++.h>
using namespace std;
vector <int> ans;
stack <int> poz[500002];
std::vector<int> solve(std::vector<int> A)
{
    for (int i = 0; i < A.size(); i++)
    {
        poz[A[i]].push(i);
    }
    sort(A.begin(), A.end());
    ans.clear();
    for (int i = 0; i < A.size(); i += 2)
    {
        ans.push_back(poz[A[i]].top());
        poz[A[i]].pop();
    }
    return ans;
}