object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    
    val N = sc.nextInt()
    val X = Array.fill(N)(sc.nextInt())
    val SX = X.sorted
    val SXIdx = SX.zipWithIndex.toMap
    val medianL = X(N / 2)
    val medianR = X(N / 2 + 1)
    
    val r = new Array[Int](N)
    var i = 0
    while (i < N) {
      if (SXIdx(X(i)) < N / 2)
        r(i) = medianR
      else
        r(i) = medianL
      i += 1
    }
    println(r.mkString(" "))
  }
}