fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val X = readLine()!!.split(" ").map { it.toInt() }.toMutableList()
    val sorted = X.sorted()

    val a = Math.floor((1.toDouble() + N.toDouble()) / 2.0).toInt() - 1
    val b = Math.ceil((1.toDouble() + N.toDouble()) / 2.0).toInt() - 1
    for (i in 0 until N) {
        if (X[i] <= sorted[a]) {
            println(sorted[b])
        } else {
            println(sorted[a])
        }
    }
}