n = int(eval(input()))

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

y = list(sorted(x))

a = y[n // 2 - 1]

b = y[n // 2]

for i in range(n):

  if x[i] >= b:

    print(a)

  else:

    print(b)

import sys

n, *x = list(map(int, sys.stdin.read().split()))

y = list(sorted(x))

a = y[n // 2 - 1]

b = y[n // 2]

print((*[a if x[i] >= b else b for i in range(n)]))

n = int(eval(input()))
x = list(map(int, input().split()))
y = list(sorted(x))
a = y[n // 2 - 1]
b = y[n // 2]
for i in range(n):
    if x[i] >= b:
        print(a)
    else:
        print(b)

import sys

n, *x = list(map(int, sys.stdin.read().split()))
y = list(sorted(x))
a = y[n // 2 - 1]
b = y[n // 2]
print((*[a if x[i] >= b else b for i in range(n)]))

-n = int(eval(input())) -x = list(map(int, input().split())) +import sys + +n, *x = list(map(int, sys.stdin.read().split())) -for i in range(n): -    if x[i] >= b: -        print(a) -    else: -        print(b) +print((*[a if x[i] >= b else b for i in range(n)]))