fun main(args:Array<String>) {
	val n = readLine()!!.toInt()
	val x = readLine()!!.split(" ").map{ it.toLong() }
	val ml = x.sorted()[n/2-1]
	val mr = x.sorted()[n/2]
	x.fold(StringBuilder()) {acc, it->
		acc.append(if(it<=ml) "$mr\n" else "$ml\n")
	}.let {println(it)}
	
}