object Main extends App {
	val n = scala.io.StdIn.readInt
	val x = scala.io.StdIn.readLine.split(" ").map(_.toLong)
	val y = x.sorted

	val a = y(n/2)
	val b = y(n/2 - 1)

	for(i<-0 until n){
		if(x(i) < a){
			println(a)
		}else{
			println(b)
		}
	}
 
}