#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int n;
vector<int> a;
vector<int> ind;
vector<bool> used;
// vector<int> mine;

std::vector<int> solve(std::vector<int> A)
{
    // mine.clear();
    a = A;
    n = a.size();
    ind.clear();
    used.clear();
    ind.resize(n, 0);
    used.resize(n, false);
    used.assign(n, false);
    ll tt = 0;
    for(int i = 0; i < n;i ++)
    {
        tt += a[i];
        ind[i] = i;
    }
    sort(ind.begin(), ind.end(), [&](int x, int y) {
        return a[ind[x]] < a[ind[y]];
    });
    int len = (n + 1) / 2;
    ll sum = 0;
    for(int i = 0; i < len; i++)
    {
        sum += a[ind[i]];
    }
    vector<int> ans;
    for(int i = 0; i < n; i += 2)
        ans.push_back(ind[i]);
    for(int i = 1; i < n; i += 2)
        ans.push_back(ind[i]);
    return ans;
    if(sum >= (tt + 1) / 2)
    {
        for(int x = 0; x < 0 + len; x++)
        {
            used[ind[x]] = true;
            ans.push_back(ind[x]);
        }
    }
    else
    {
        for(int l = 1; l + len <= n; l++)
        {
            if(sum - a[ind[l - 1]] + a[ind[l + len - 1]] >= (tt + 1) / 2)
            {
                for(int x = l; x < l + len; x++)
                {
                    used[ind[x]] = true;
                    ans.push_back(ind[x]);
                }
                break;
            }
            sum -= a[ind[l - 1]];
            sum += a[ind[l + len - 1]];
        }
    }
    for(int i = 0; i < n; i++)
    {
        if(!used[ind[i]])
            ans.push_back(ind[i]);
    }
    return ans;
    // ll sum = 0, maxim = a[ind[n - 1]];
    // int p = n - 1;
    // while(p >= 0 && sum + a[ind[p]] - maxim < (tt + 1) / 2)
    // {
    //     taken.push_back(p);
    //     sum += a[ind[p]];
    //     p -= 2;
    // }
    // p++;
    // p = max(p, 0);
    // vector<int> wh;

}