// D - Median of Medians
// https://abc107.contest.atcoder.jp/tasks/arc101_b

import scala.io.StdIn.readLine

object Main extends App {

  val n: Int = readLine.toInt
  val as: List[Long] = readLine.split(" ").map(_.toLong).toList

  def mean(as: List[Long]): Long = {
    val i = as.length / 2  // + 1 - 1
    as.sorted.apply(i)
  }

  val pss = (1 to n).toList.flatMap(i => as.sliding(i))
  val ms = pss.map(ps => mean(ps))

  val m = mean(ms)

  println(m)

}
