import scala.io.StdIn
object Main extends App {
  val n = StdIn.readLine().toInt
  val x = StdIn.readLine().split(' ').map(_.toInt)
  val y = x.sorted


  // before: 2  4   4  3
  // sorted: 2 [3] [4] 4
  //
  // (1)   :   4 4 3
  // (2)   : 2   4 3
  // (3)   : 2 4   3
  // (4)   : 2 4 4  

  val mid = n / 2 // 2
  val mid_left = y(mid - 1)
  val mid_right = y(mid)

  val r = x.map(xi => if (xi <= mid_left) mid_right else mid_left)

  r.foreach(println)

}