import scala.io.StdIn

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

  val mid = (n / 2) - 1
  val r = (0 until n).map { i =>
    val b = a.filter(p => p._2 != i).sortBy(p => p._1)
    //println(b.mkString(""))
    b(mid)._1
  }

  r.foreach(println)

}
