import scala.io.StdIn._
object Main extends App {
  val n = readInt
  val x = readLine.split(" ").map(_.toInt)
  val sorted = x.sorted
  val l = sorted(n / 2 - 1)
  val r = sorted(n / 2)

  x.foreach(i => {
    if (i < r) println(r)
    else println(l)
  })
}
