#include <bits/stdc++.h>
const int MAXN = 2'000'000;
long long lim[2];
long long add[2];
std::vector<int> added[2];
std::vector<int> sol[2];
bool took[MAXN + 1];
std::vector<int> solve(std::vector<int> a) {
  std::vector<std::pair<int, int>> v;
  for( int i = 0; i < a.size(); i++ )
    v.push_back({a[i], i});
  std::sort(v.begin(), v.end());
  std::reverse(v.begin(), v.end());
  long long s = 0;
  for( int i = 0; i < a.size(); i++ )
    s += a[i];
  if(s % 2 == 1)
    lim[0] = lim[1] = s / 2;
  else {
    lim[0] = s / 2;
    lim[1] = s / 2 - 1;
  }
  int mn = 1e9;
  for( int i = 0; i < a.size(); i++ ) {
    add[0] = add[1] = 0;
    added[0].clear();
    added[1].clear();
    for( int j = 0; j < a.size(); j++ )
      took[j] = 0;
    bool fail = 0;
    took[i] = 1;
    for( int j = 0; j < a.size(); j++ ) {
      if(j != i) {
        if(add[1] + v[j].first <= lim[1]) {
          add[1] += v[j].first;
          added[1].push_back(v[j].second);
          took[j] = 1;
        }
      }
    }
    for( int j = 0; j < a.size(); j++ ) {
      if(!took[j]){
        add[0] += v[j].first;
        added[0].push_back(v[j].second);
        took[j] = 1;
        if(add[0] > lim[0]){
          fail = 1;
          break;
        }
      }
    }
    if(!fail) {
      if(abs((int)added[1].size() + 1 - (int)added[0].size()) < mn) {
        mn = abs((int)added[1].size() + 1 - (int)added[0].size());
        sol[0] = added[0];
        sol[1] = added[1];
        sol[1].push_back(v[i].second);
      }
    }
  }
  std::vector<int> ret;
  for( int x : sol[1] )
    ret.push_back(x);
  for( int x : sol[0] )
    ret.push_back(x);
  return ret;
}
