#include<bits/stdc++.h>

using namespace std;

const int maxn=100010;

int a[maxn],b[maxn],mid,c[maxn];

inline int read()
{
	int x=0,w=0; char ch=0;
	while(!isdigit(ch))
	{
		w|=ch=='-';ch=getchar();
	}
	while(isdigit(ch))
		x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return w?-x:x;
}

inline void write(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10+'0');
}

int main()
{
	int n;
	n=read();
	int l,r;
	int x=0;
	for(int i=1;i<=n;i++)
	{
		a[i]=read();
		b[x]=a[i];
		x++;
	}
		
	int flag;
	for(l=1;l<=n;l++)
	{
		for(r=l+1;r<=n;r++)
		{
			c[r]=a[r];
			sort(c,c+l-1);
			flag=r-l+1;
			b[x]=c[(flag/2+1)];
			x++;
		}
	}
	sort(b,b+x);
	write(b[x/2+1]);
	return 0;
 }