import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val x = (1..n).map { sc.nextInt() }

  val xx = x.sorted()
  val mid = n / 2 - 1


  val m1 = xx[mid]
  val m2 = xx[mid+1]

  var ans = mutableListOf<Int>()
  for (xi in x) {
    if (xi <= m1) {
      ans.add(m2)
    } else {
      ans.add(m1)
    }
  }


  println(ans.joinToString("\n"))

}