N=io.read("n")
X={}
B={}
for i=1,N do
  X[i]=io.read("n")
  B[i]=X[i]
end
table.sort(B)
left=B[N//2]
right=B[N//2+1]
for i=1,N do
  if X[i]<=left then
    print(right)
  	elseif X[i]>=right then
    print(left)
  end
end
