#include "partition.h"
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
const int NMAX=1000005;

using namespace std;

struct duo
{
    int idx,val;
};

vector<duo> ans;
vector<int> ansF;
bool shown[NMAX];
int change[NMAX];

bool cmp(duo a,duo b)
{
    if(a.val<b.val) return true;
    else if(a.val>b.val) return false;
    else
    {
        if(a.idx<b.idx) return true;
        else return false;
    }
}

vector<int> solve(std::vector<int> v)
{
    int cnt=-1;
    for(auto i:v)
    {
        cnt++;
        int val=i;
        ans.push_back({cnt,val});
    }
    sort(ans.begin(),ans.end(),cmp);
    for(int i=0;i<ans.size();i+=2) cout<<ans[i].idx<<" ";
    for(int i=1;i<ans.size();i+=2) cout<<ans[i].idx<<" ";
    return ansF;
}

/*1
8
6 6 3 1 1 4 4 3*/
