#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define in read()
#define fur(i,a,b) for(int i=a;i<=b;i++)
#define fdr(i,a,b) for(int i=a;i>=b;i--)
#define xx 10001
inline int read()
{
	int x=0,f=1;char ch=getchar();
	for(;!isalnum(ch);ch=getchar()) if(ch=='-') f=-1;
	for(;isalnum(ch);ch=getchar()) x=x*10+ch-'0';
	return x*f;
}
int f[xx][xx];
int ri[xx*xx];
int a[xx];
struct gun
{
	int value;
	int name;
}b[xx];
inline bool cmp(gun fe,gun fi){return fe.value<fi.value;}
int main()
{
	int n,m=0;
	n=in;
	fur(i,1,n) a[i]=in,b[i].value=a[i],b[i].name=i;
	sort(b+1,b+n+1,cmp);
	f[n][1]=n/2+1;
	ri[++m]=b[f[n][1]].value;
	fdr(i,n-1,1)
	{
		fur(j,1,n-i)
		{
			if((i+1)%2==0)
			{
				if(a[i+j]>=b[f[i+1][j]].value) f[i][j]=f[i+1][j]-1;
				if(a[i+j]<b[f[i+1][j]].value) f[i][j]=f[i+1][j];
			}
			else
			{
				if(a[i+j]>b[f[i+1][j]].value) f[i][j]=f[i+1][j];
				if(a[i+j]<=b[f[i+1][j]].value) f[i][j]=f[i+1][j]+1;
			}
			ri[++m]=b[f[i][j]].value;
		}
		if((i+1)%2==0)
		{
			if(a[n-i]>=b[f[i+1][n-i]].value) f[i][n-i+1]=f[i+1][n-i]-1;
			if(a[n-i]<b[f[i+1][n-i]].value) f[i][n-i+1]=f[i+1][n-i];
		}
		else
		{
			if(a[n-i]>b[f[i+1][n-i]].value) f[i][n-i+1]=f[i+1][n-i];
			if(a[n-i]<=b[f[i+1][n-i]].value) f[i][n-i+1]=f[i+1][n-i]+1;
		}
		ri[++m]=b[f[i][n-i+1]].value;
	}
	sort(ri+1,ri+m+1);
	printf("%d\n",ri[m/2+1]);
	return 0;
}