fun main(args: Array<String>){
    val N :Int = readLine()!!.toInt()
    val x = readLine()!!.split(" ").map(String::toInt)
    val y = x.toIntArray()
    y.sort()
    val ml = y[N/2-1]
    val mr = y[N/2]
    for(i in x.indices){
      if(x[i]<=ml){
        println(mr)
      }
      else{
        println(ml)
      }
    }
}