n=int(eval(input()))

x=[int(i) for i in input().split()]

y=sorted(x)

l=y[n//2-1]

m=y[n//2]

for i in range(n):

    if x[i]<=l:

        print(m)

    else:

        print(l)

n=int(eval(input()))

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

y=sorted(x)

k,l=y[n//2-1],y[n//2]

for i in range(n):

    if x[i]<=k:

        print(l)

    else:

        print(k)
n = int(eval(input()))
x = [int(i) for i in input().split()]
y = sorted(x)
l = y[n // 2 - 1]
m = y[n // 2]
for i in range(n):
    if x[i] <= l:
        print(m)
    else:
        print(l)

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

-x = [int(i) for i in input().split()] +x = list(map(int, input().split())) -l = y[n // 2 - 1] -m = y[n // 2] +k, l = y[n // 2 - 1], y[n // 2] -    if x[i] <= l: -        print(m) +    if x[i] <= k: +        print(l) -        print(l) +        print(k)