#include
using namespace std;
int max(int a[],int left,int right)
{
int mid=(left+right)>>1;
int x,y;
if(left==right-1)return a[left];
x=max(a,left,mid);
y=max(a,mid,right);
return x>y?x:y;
}
void main()
{
int n,i;
int a[1000];
cin>>n;
for(i=0;i
cout<