fun main(args: Array<String>) {
    abc094c()
}

private data class ValueIndexed(val value: Long, val index: Int)

fun abc094c() {
    val n = readLine()!!.toInt()
    val xList = readLine()!!.split(" ").map { it.toLong() }
        .mapIndexed { index, l -> ValueIndexed(l, index) }.sortedBy { it.value }

    val centerLeft = xList[xList.size / 2 - 1].value
    val centerRight = xList[xList.size / 2].value

    val answer = xList.sortedBy { it.index }
        .map { if (it.value < centerRight) centerRight else centerLeft }

    println(answer.joinToString(separator = System.lineSeparator()))
}
