#include<iostream>
#include<utility>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#define forn(i, x, n) for(int i = x; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const bool DEBUG = 0;

void solve(){
    int n;
    cin>>n;
    int sz = (1 << n);
    int a[sz];
    forn(i, 0, sz) cin>>a[i];
    int l = 0, r = sz/2;
    forn(i, 0, sz/2) if(a[l] < a[i]) l = i;
    forn(i, sz/2, sz) if(a[r] < a[i]) r = i;
    cout<< ((a[l] > a[r])? r+1: l+1);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t = 1;
    //cin>>t;
	//while(t--) cout<<solve()<<'\n';
	while(t--) solve(), cout<<'\n';


}

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

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<min(min(a,b),min(c,d));
    return 0;
}