#include <cstdio>
#include <algorithm>
using namespace std;
inline int read()
{
	int x = 0, w = 1; char c = getchar();
	while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	while(c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); }
	return x * w; 
}
int n,p;
int a[100010];
struct node
{
	int a,int b;
}q[100010];
void cmp1(node x,node y){return x.b<y.b;}
void cmp2(node x,node y){return x.a<y.a;}
int main()
{
	n=read();
	for(int i=1;i<=n;i++) q[i].a=i,q[i].b=read();
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
		{
			sort(q+1+i,q+1+j,cmp1);
			a[++p]=q[(j-i+1)/2+1];
			sort(q+1+i,q+1+j,cmp2);
		}
	for(int i=1;i<=n;i++) a[++p]=q[i].b;
	sort(a+1,a+1+p);
	printf("%d",a[p/2+1]);
	return 0; 
}
