#include <bits/stdc++.h>
#define ll long long
using namespace std;
int N;
vector <int> solve(vector <int> A)
{
  N = A.size();
  if(N > 20) exit(333);
  int best = N, bestmask;
  ll sum0 = 0, half;
  for(int i = 0; i < N; i++) sum0 += A[i];
  half = sum0 >> 1;
  for(int mask = 1; mask < (1 << N); mask++)
  {
    ll sum = 0, prev = 0;
    int pop = __builtin_popcount(mask);
    if(abs(N - (pop << 1)) >= best) continue;
    for(int i = 0; i < N; i++)
    {
      if(!(mask & (1 << i))) continue;
      prev = sum;
      sum += A[i];
    }
    if((sum < half) || (prev >= half)) continue;
    best = abs(N - (pop << 1));
    bestmask = mask;
  }
  vector <int> L, R;
  for(int i = 0; i < N; i++)
  {
    if(bestmask & (1 << i)) L.push_back(i);
    else R.push_back(i);
  }
  for(int i = 0; i < R.size(); i++) L.push_back(R[i]);
  return L;
}