#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include "partition.h"

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ar array
#define int long long
#define all(v) v.begin(), v.end()

const int N = 1e5 + 20;
const int MOD = 1e9 + 7;
const int INF = 1e16;

template<typename T>
void chmin(T &a, T b){a = min(a, b);};
template<typename T>
void chmax(T &a, T b){a = max(a, b);};
template<typename T>
void mm(T &x){
    x %= MOD;
    if (x < 0) x += MOD;
};

std::vector<signed> solve(std::vector<signed> A) {
    vector<ar<int,2 > > B;
    int n = A.size();
    for (int i = 0;i < n;i++)B.push_back({A[i], i});
    sort(all(B));
    int X = 0;
    for (auto u: A)X += u;
    X = (X + 1) / 2;
    int ans = n;
    int msk = 0;
    for (int i = 0;i < (1 << (n - 1));i++) {
        int sum = 0;
        for (int j = 0;j < n - 1;j++) {
            if ((1 << j) & i)sum += B[j][0];
        }
        if (sum >= X - B.back()[0] && sum < X) {
            int res = abs(2 * (__builtin_popcount(i) + 1) - n);
            if (res < ans)msk = i;
        }
    }
    vector<signed> v;
    for (int i = 0;i < n - 1;i++) {
        if ((1 << i) & msk)v.push_back(B[i][1]);
    }
    v.push_back(B.back()[1]);
    for (int i = 0;i < n - 1;i++) {
        if ((1 << i) & msk) {

        }
        else  v.push_back(B[i][1]);
    }
    return v;
}


#define int signed