#include <bits/stdc++.h>
long long lim[2];
long long add[2];
std::vector<int> added[2];
std::vector<int> sol[2];
std::vector<int> solve(std::vector<int> a) {
  added[0].clear();
  added[1].clear();
  add[0] = add[1] = 0;

  std::vector<std::pair<int, int>> v;
  long long s = 0;
  for( int i = 0; i < a.size(); i++ ) {
    v.push_back({a[i], i});
    s += a[i];
  }
  std::sort(v.begin(), v.end());
  std::reverse(v.begin(), v.end());
  if(s % 2 == 1)
    lim[0] = lim[1] = s / 2;
  else {
    lim[0] = s / 2;
    lim[1] = s / 2 - 1;
  }
  int idx = -1;
  int tmp = 0;
  for( int j = 0; j < a.size(); j++ ) {
    if(add[tmp] + v[j].first <= lim[tmp]) {
      add[tmp] += v[j].first;
      added[tmp].push_back(v[j].second);
      tmp ^= 1;
    }else if(add[tmp ^ 1] + v[j].first <= lim[tmp ^ 1]) {
      add[tmp ^ 1] += v[j].first;
      added[tmp ^ 1].push_back(v[j].second);
    }else {
      idx = j;
    }
  }
  int mn = 1e9;
  added[1].push_back(v[idx].second);
  if(add[1] + v[idx].first >= s / 2) {
    mn = abs((int)added[1].size() - (int)added[0].size());
    sol[1] = added[1];
    sol[0] = added[0];
  }

  idx = -1;
  tmp = 1;
  add[0] = add[1] = 0;
  added[0].clear();
  added[1].clear();
  for( int j = 0; j < a.size(); j++ ) {
    if(add[tmp] + v[j].first <= lim[tmp]) {
      add[tmp] += v[j].first;
      added[tmp].push_back(v[j].second);
      tmp ^= 1;
    }else if(add[tmp ^ 1] + v[j].first <= lim[tmp ^ 1]) {
      add[tmp ^ 1] += v[j].first;
      added[tmp ^ 1].push_back(v[j].second);
    }else {
      idx = j;
    }
  }
  added[1].push_back(v[idx].second);
  if(add[1] + v[idx].first >= s / 2 && abs((int)added[1].size() - (int)added[0].size()) < mn) {
    mn = abs((int)added[1].size() - (int)added[0].size());
    sol[1] = added[1];
    sol[0] = added[0];
  }

  std::vector<int> ret;
  for( int x : sol[1] )
    ret.push_back(x);
  for( int x : sol[0] )
    ret.push_back(x);
  return ret;
}
