fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val xx = readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    val xxs = xx.sorted()

    val m1 = xxs[(n/2)-1]
    val m2 = xxs[n/2]

    xx.forEach {
        if (it <= m1) {
            println(m2)
        } else {
            println(m1)
        }
    }
}