n = int(eval(input()))

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

lsort = sorted(l)

l1 = lsort[n//2-1]

l2 = lsort[n//2]

for i in l:

    print((l1 if i>=l2 else l2))
n = int(eval(input()))

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

x_sort = sorted(x)

mini = x_sort[n//2-1]

maxi = x_sort[n//2]

if mini == maxi:

    for _ in range(n):

        print(mini)

else:

    for a in x:

        if a < maxi:

            print(maxi)

        else:

            print(mini)
n = int(eval(input()))
l = list(map(int, input().split()))
lsort = sorted(l)
l1 = lsort[n // 2 - 1]
l2 = lsort[n // 2]
for i in l:
    print((l1 if i >= l2 else l2))

n = int(eval(input()))
x = list(map(int, input().split()))
x_sort = sorted(x)
mini = x_sort[n // 2 - 1]
maxi = x_sort[n // 2]
if mini == maxi:
    for _ in range(n):
        print(mini)
else:
    for a in x:
        if a < maxi:
            print(maxi)
        else:
            print(mini)

-l = list(map(int, input().split())) -lsort = sorted(l) -l1 = lsort[n // 2 - 1] -l2 = lsort[n // 2] -for i in l: -    print((l1 if i >= l2 else l2)) +x = list(map(int, input().split())) +x_sort = sorted(x) +mini = x_sort[n // 2 - 1] +maxi = x_sort[n // 2] +if mini == maxi: +    for _ in range(n): +        print(mini) +else: +    for a in x: +        if a < maxi: +            print(maxi) +        else: +            print(mini)