#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctype.h>
#include <assert.h>
#include <random>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define endl '\n'

using namespace std;
using namespace __gnu_pbds;

template <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

#include "partition.h"

vector<int> solve(vector<int> A) {
    vector<int> ans;
    vector<pair<int,int>> a;
    for(int i = 0; i < A.size(); i++) a.push_back({A[i], i});
    sort(a.begin(), a.end());
    for(int i = 1; i < A.size(); i+=2) {
        ans.push_back(a[i].second);
    }
    for(int i = 0; i < A.size(); i+=2) {
        ans.push_back(a[i].second);
    }
    return ans;
}
/*
1
9
5 6 6 3 1 1 4 4 3
*/
