#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int n, a[100010], b[100000000];
int tmp[100010];
//求出[x,y]区间的中位数 
int midn(int x, int y) {
	memset(tmp, 0, sizeof(tmp));
	int num=y-x+1;
	for (int i=1; i<=num; ++i) {
		tmp[i]=a[x+i-1];
	}
	sort(tmp+1, tmp+num+1);
	return tmp[num/2+1];
}
int main() {
	scanf("%d", &n);
	int cnt=0;
	for (int i=1; i<=n; ++i) {
		scanf("%d", &a[i]);
	}
	for (int j=1; j<=n; ++j) {
		for (int i=1; i<=n-j+1; ++i) {
			int m=midn(i,i+j-1);
			++cnt;
			b[cnt]=m;
			//printf("%d %d\n", i, j);
		}
	}
	int num=n*(n-1)/2+n;
	
	/*printf("%d %d\n", cnt, num);
	for (int i=1; i<=num; ++i)
		printf("%d ", b[i]);
	printf("\n");*/
	
	sort(b+1, b+num+1);
	printf("%d\n", b[num/2+1]);
	return 0;
} 