import scala.io.StdIn._
object Main {
  def main(args: Array[String]): Unit = {
    val N = readInt
    val a = readLine.split("\\s+").toSeq.map{_.toInt}
    val m = scala.collection.mutable.ListBuffer[Int]()
    for(i <- 0 to N - 1; n <- i to N - 1){
      val aa = a.drop(i).dropRight(N - 1 - n).sorted
      m += aa(((n-i+1)/2).toInt)
    }
    val n = N * (N + 1) / 2
    val mm = m.sorted
    println(mm((n/2).toInt).toString)
  }
}
