N = int(eval(input()))

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

x0,x1 = sorted(xn)[N//2-1:N//2+1]

xm = (x0+x1)/2

for x in xn:

  print((x1 if x < xm else x0))

N = int(eval(input()))

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

x0,x1 = sorted(xn)[N//2-1:N//2+1]

res = [x0 if x0 < x else x1 for x in xn]

print(('\n'.join(map(str,res))))

N = int(eval(input()))
xn = list(map(int, input().split()))
x0, x1 = sorted(xn)[N // 2 - 1 : N // 2 + 1]
xm = (x0 + x1) / 2
for x in xn:
    print((x1 if x < xm else x0))

N = int(eval(input()))
xn = list(map(int, input().split()))
x0, x1 = sorted(xn)[N // 2 - 1 : N // 2 + 1]
res = [x0 if x0 < x else x1 for x in xn]
print(("\n".join(map(str, res))))

-xm = (x0 + x1) / 2 -for x in xn: -    print((x1 if x < xm else x0)) +res = [x0 if x0 < x else x1 for x in xn] +print(("\n".join(map(str, res))))