include [HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
define NUM 100001
using namespace std;
int main()
{
int n;
scanf(“%d”,&n);
pair[HTML_REMOVED] a[n+1];
int temp=1;
for(int i=1;i<=n;i)
{
scanf(“%d”,&a[i].first);
if(pow(2,temp)-1>=i)
{
a[i].second=temp;
}
else
{
temp;
a[i].second=temp;
}
}
long long int res[NUM];
memset(res,0,sizeof(res));
for(int i=1;i<=temp;i)
{
for(int j=1;j<=n;j)
if(a[j].second==i)
res[i]+=a[j].first;
}
long long int ans=res[1];
for(int i=1;i<=temp;i)
if(ans<res[i])
{
ans=res[i];
}
for(int i=1;i<=temp;i)
if(res[i]==ans)
printf(“%d”,i);
return 0;
}