import scala.io.StdIn._

object Main extends App {
  val n = readInt()
  val as = readLine().split(' ').map(_.toInt)
  
  def median(xs: scala.collection.Seq[Int]): Int = {
    val elem: Int = xs.length / 2
    val sorted = xs.sorted
    sorted(elem)
  }
  
  val buf = scala.collection.mutable.ArrayBuffer.empty[Int]
  
  (0 to n - 1).map { l =>
    (l + 1 to n).map { r =>
      val partial = as.slice(l, r)
      val m = median(partial)
      buf += m
    }
  }
  
  println(median(buf))
}