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 out = new java.io.PrintWriter(System.out)
  for(i <- 0 until n) {
    val median = if(x(i) < sx(h)) sx(h) else sx(h-1)
    out.println(median)
  }
  out.flush
}