#include<bits/stdc++.h> using namespace std; int max_num(int a[], int m,int n) { int mid = (m+n)/2; if(m==n) return a[m]; else { int maxa = max_num(a, m, mid); int maxb = max_num(a, mid+1, n); return max(maxa, maxb); } } int main() { int num; cin>>num; int a[num]; for(int i=0;i<num;i++) cin>>a[i]; cout<<max_num(a, 0, num-1); return 0; }