import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt
  val x = in.readLine.split(" ").map(_.toInt)
  val sx = x.sorted

  val h = n / 2
  val left = sx(h-1)
  val right = sx(h)
  val out = new java.io.PrintWriter(System.out)
  x.foreach(i => {
    if(i < right) out.println(right)
    else out.println(left)
  })
  out.flush
}