import statistics

n = int(eval(input()))-1

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

N = sorted([[x,y] for y, x in enumerate(a)])



ans = [0] * (n+1)

for i in range(n+1):

    if i < n//2+1: 

        ans[N[i][1]] = N[n//2+1][0]

    else: ans[N[i][1]] = N[n//2][0]

for x in ans: print(x)
n = int(eval(input()))

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

x.sort(key=lambda x:x[1])

ans = [""]*n

for i in range(n):

  if (n+1)//2 >= i+1: ans[x[i][0]] = x[(n+1)//2][1]

  else: ans[x[i][0]] = x[(n+1)//2-1][1]



print(("\n".join(map(str, ans))))
import statistics

n = int(eval(input())) - 1
a = list(map(int, input().split()))
N = sorted([[x, y] for y, x in enumerate(a)])
ans = [0] * (n + 1)
for i in range(n + 1):
    if i < n // 2 + 1:
        ans[N[i][1]] = N[n // 2 + 1][0]
    else:
        ans[N[i][1]] = N[n // 2][0]
for x in ans:
    print(x)

n = int(eval(input()))
x = list(enumerate(map(int, input().split())))
x.sort(key=lambda x: x[1])
ans = [""] * n
for i in range(n):
    if (n + 1) // 2 >= i + 1:
        ans[x[i][0]] = x[(n + 1) // 2][1]
    else:
        ans[x[i][0]] = x[(n + 1) // 2 - 1][1]
print(("\n".join(map(str, ans))))

-import statistics - -n = int(eval(input())) - 1 -a = list(map(int, input().split())) -N = sorted([[x, y] for y, x in enumerate(a)]) -ans = [0] * (n + 1) -for i in range(n + 1): -    if i < n // 2 + 1: -        ans[N[i][1]] = N[n // 2 + 1][0] +n = int(eval(input())) +x = list(enumerate(map(int, input().split()))) +x.sort(key=lambda x: x[1]) +ans = [""] * n +for i in range(n): +    if (n + 1) // 2 >= i + 1: +        ans[x[i][0]] = x[(n + 1) // 2][1] -        ans[N[i][1]] = N[n // 2][0] -for x in ans: -    print(x) +        ans[x[i][0]] = x[(n + 1) // 2 - 1][1] +print(("\n".join(map(str, ans))))