
cpp
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int n;
cin >> n;
int N = pow(2, n);
int s[129] = { 0 };
for (int i = 1; i <= N; i++)cin >> s[i];
int zuo = 0;
int you = 0;
int l = 0;
int r = 0;
for (int i = 1; i <= N / 2; i++) {
if (zuo < s[i]) {
zuo = s[i];
l = i;
}
}
for (int i = N/2+1; i <= N ; i++) {
if (you < s[i]) {
you = s[i];
r = i;
}
}
if (zuo > you)cout << r;
else cout << l;
return 0;
}

