object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val x = List.fill(n)(sc.nextInt())
  val sorted = x.sorted
  val med1 = sorted.apply(n/2)
  val med2 = sorted.apply(n/2-1)
  for (i <- 1 to n){
    if (x(i-1)<=med2){
      println(med1)
    } else{
      println(med2)
    }
  }
}