N = int(eval(input()))

X = list(map(int, input().split()))

X2 = sorted(X)

left = X2[(N//2)-1]

right = X2[N//2]

for i in range(N):

    print((left if X[i] > left else right))
# coding: utf-8

import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

A = lr()

sorted_A = sorted(A)

mid = N // 2 - 1

left = sorted_A[mid]

right = sorted_A[mid+1]

answer = [left if a > left else right for a in A]

print(('\n'.join(map(str, answer))))

N = int(eval(input()))
X = list(map(int, input().split()))
X2 = sorted(X)
left = X2[(N // 2) - 1]
right = X2[N // 2]
for i in range(N):
    print((left if X[i] > left else right))

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = lr()
sorted_A = sorted(A)
mid = N // 2 - 1
left = sorted_A[mid]
right = sorted_A[mid + 1]
answer = [left if a > left else right for a in A]
print(("\n".join(map(str, answer))))

-N = int(eval(input())) -X = list(map(int, input().split())) -X2 = sorted(X) -left = X2[(N // 2) - 1] -right = X2[N // 2] -for i in range(N): -    print((left if X[i] > left else right)) +# coding: utf-8 +import sys + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +N = ir() +A = lr() +sorted_A = sorted(A) +mid = N // 2 - 1 +left = sorted_A[mid] +right = sorted_A[mid + 1] +answer = [left if a > left else right for a in A] +print(("\n".join(map(str, answer))))