eval(input())

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

z=sorted(x)[(len(x))//2-1:]

for c in x:print((z[c<=z[0]]))
from statistics import *

N = int(eval(input()))

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

Y = sorted(X)

m = median(X)



for x in X:

  if x<=m:

    print((Y[N//2]))

  else:

    print((Y[N//2-1]))
eval(input())
x = list(map(int, input().split()))
z = sorted(x)[(len(x)) // 2 - 1 :]
for c in x:
    print((z[c <= z[0]]))

from statistics import *

N = int(eval(input()))
X = list(map(int, input().split()))
Y = sorted(X)
m = median(X)
for x in X:
    if x <= m:
        print((Y[N // 2]))
    else:
        print((Y[N // 2 - 1]))

-eval(input()) -x = list(map(int, input().split())) -z = sorted(x)[(len(x)) // 2 - 1 :] -for c in x: -    print((z[c <= z[0]])) +from statistics import * + +N = int(eval(input())) +X = list(map(int, input().split())) +Y = sorted(X) +m = median(X) +for x in X: +    if x <= m: +        print((Y[N // 2])) +    else: +        print((Y[N // 2 - 1]))