fun main(args: Array<String>) {
    val N = readInputLine().toInt()
    
    val Xs = readInputLine().split(" ").map {it.toInt()}.toList()
    
    val (lower, higher) = Xs.sorted().toIntArray().let {Pair(it[N / 2 - 1], it[N / 2])}
    
    for (x in Xs) {
        if (x >= higher) {
            println(lower)
        } else {
            println(higher)
        }
    }
}

fun readInputLine(): String {
    return readLine()!!
}
