import std.stdio, std.string, std.conv;
import std.typecons;
import std.algorithm, std.array, std.range, std.container;
import std.math;

void main() {
	auto N = readln.split[0].to!uint;
	auto a = readln.split.to!(uint[]).array;
	auto index = sort!( (x,y) => a[x] < a[y] )(N.iota.array).array;
	
	uint group(uint k) {
		return min(k-1, N-k+1) + min(k, N-k+1);
	}
	
	uint center = (N*N - N*(N+1)/2 + N)/2 + 1;
	uint count = 0;
	foreach (k; index) {
		auto next = count + group(k+1);
		writeln(k, " ", count, " ", center, " " , next);
		if (count < center && center <= next) { writeln(a[k]); return; }
		else count = next;
	}
	
	writeln(a[0]);
}