#include
#include <utility>
using namespace std;
typedef pair
Node a[150] ,tree[600]; //pair
void built(int node,int start,int end);
Node maxs(Node t1,Node t2);
Node mins(Node t1,Node t2);
int main()
{
int n;
cin>>n;
for(int i=1;i<=1<
a[i].first=i;
cin>>a[i].second;//输入国家id和国家能力值
}
built(1,1,1<
}
void built(int node,int start,int end)
{
if(start==end)
{
tree[node]=a[start];
return ;
}
int mid=(start+end)/2;
int left=node*2;
int right=node*2+1;
built(left,start,mid);
built(right,mid+1,end);
tree[node]=maxs(tree[left],tree[right]);
}
Node maxs(Node t1,Node t2)
{
return t1.second>t2.second ? t1:t2;
}
Node mins(Node t1,Node t2)
{
return t1.second