n = int(eval(input()))

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

temp = sorted(zip(x, list(range(n))))

ans = [None] * n

for i in range(n):

    idx = n//2

    if i >= idx:

        idx -= 1

    ans[temp[i][1]] = temp[idx][0]

for item in ans:

    print(item)
n = int(eval(input()))

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

temp = sorted(x)

idx = n//2

y = temp[idx-1]

z = temp[idx]

for item in x:

    if item >= z:

        print(y)

    else:

        print(z)
n = int(eval(input()))
x = list(map(int, input().split()))
temp = sorted(zip(x, list(range(n))))
ans = [None] * n
for i in range(n):
    idx = n // 2
    if i >= idx:
        idx -= 1
    ans[temp[i][1]] = temp[idx][0]
for item in ans:
    print(item)

n = int(eval(input()))
x = list(map(int, input().split()))
temp = sorted(x)
idx = n // 2
y = temp[idx - 1]
z = temp[idx]
for item in x:
    if item >= z:
        print(y)
    else:
        print(z)

-temp = sorted(zip(x, list(range(n)))) -ans = [None] * n -for i in range(n): -    idx = n // 2 -    if i >= idx: -        idx -= 1 -    ans[temp[i][1]] = temp[idx][0] -for item in ans: -    print(item) +temp = sorted(x) +idx = n // 2 +y = temp[idx - 1] +z = temp[idx] +for item in x: +    if item >= z: +        print(y) +    else: +        print(z)