import scala.io.StdIn

object Main extends App {
  val n = StdIn.readLine().toInt
  val a = StdIn.readLine().split(' ').map(_.toInt)

  val mid = (n / 2) - 1
  val r = (0 until n).map { i =>
    val t = a.slice(0, i) ++ a.slice(i+1, n)
    val s = t.sorted
    //println(s.mkString(" "))
    s(mid)
  }

  r.foreach(println)

}