#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef pair<int, int> ii;
typedef vector<ii> vii;

std::vector<int> solve(std::vector<int> A) {
    int n = A.size();
    vi a(1);
    int firs;
    for (int i = 0;i<n;++i) {
        if (A[i] == pow(2, n-1)) {
            firs = i;
            break;
        }
    }
    a[0] = firs;
    for (int i = 0;i<n;++i) {
        if (i == firs)
            continue;
        a.push_back(i);
    }
    return a;
}