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