program ABC_094_C_ManyMedians
   implicit none
   integer N, i, m, Am, j, k
   integer, allocatable :: X(:), A(:)
   read(*, *) N
   allocate(X(1: N))
   read(*, *) X(1: N)
   allocate(A(1: N-1))
   A(1: n-1) = 0
   do i = 1, N
       do j = 1, i-1
           A(j) = X(j)
	   end do
	   do j = i, N-1
           A(j) = X(j+1)
	   end do
       do k = 1, N - 2
          Am = maxval(A(k+1:N-1))
	      m  = maxloc(A(k+1:N-1), 1) + k
	      if (A(k) < Am) then
	          A(m) = A(k)
		      A(k) = Am
	      end if
       end do
       write(*, *) A(N/2)
   end do
end program ABC_094_C_ManyMedians