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

#define pb push_back
#define all(s) s.begin(), s.end()
#define FOR0(i, a) for (int i = 0; i < a; i++)
#define FOR(i, a, b) for (int i = a; i < b; i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<bool> vb;


int main (void) {
    cin.tie(0), cout.tie(0)->sync_with_stdio(0);

    int n;
    cin >> n;

    ll max1, max2;
    max1 = max2 = 0;
    ll max1Ind = 0, max2Ind = 0;

    int N = pow(2, n);
    FOR(i, 1, N + 1) {
        ll temp;
        cin >> temp;
        if (i <= N/2) {
            if (temp > max1) {
                max1 = temp;
                max1Ind = i;
            }
        }
        else {
            if (temp > max2) {
                max2 = temp;
                max2Ind = i;
            }
        }
    }

    //cout << max1 << " " << max1Ind << " " << max2 << " " << max2Ind << "\n";

    if (max1 > max2) {
        cout << max2Ind << "\n";
    }
    else {
        cout << max1Ind << "\n";
    }

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

int main(){
     int A[3];
     for(int i = 0; i < 3; i++){
          cin >> A[i];
     }

     for(int i = 0; i < 2; i++){
          for(int j = 0; j < 2 - i; j++){
               if(A[j] < A[j + 1]){
                    int tmp = A[j + 1];
                    A[j + 1] = A[j];
                    A[j] = tmp;
               }
          }
     }

     if(A[0] - A[1] == A[1] - A[2]){
          cout << "Yes" << endl;
     }else{
          cout << "No" << endl;
     }

     return 0;
}