import java.util.*

fun main(args: Array<String>) {
	val scanner = Scanner(System.`in`)
	val n = scanner.nextInt()
	val xs = IntArray(n){scanner.nextInt()}
	val sorted = xs.copyOf()
	sorted.sort()
	val ml = sorted[n/2-1]
	val mr = sorted[n/2]
	xs.forEach {
		if (it<=ml) println(mr)
		else println(ml)
	}
}