#include <bits/stdc++.h> using namespace std; int n,a,b; int main() { cin>>n; cin>>a; for(int i=1; i<n; i++) cin>>b; cout<<(n%2==0)?max(a,b):min(a,b); return 0; }