N = int(input())

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

Y = list(enumerate(X))

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

mid = [Y[N//2-1][1], Y[N//2][1]]

ans = [-1] * N

for i, y in Y:

  if y <= mid[0]:

    ans[i] = mid[1]

  else:

    ans[i] = mid[0]



print(*ans, sep='\n')

N = int(eval(input()))

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

Y = sorted(X)

m1, m2 = Y[N//2-1], Y[N//2]



for x in X:

  if x <= m1:

    print(m2)

  else:

    print(m1)
N = int(input())
X = list(map(int, input().split()))
Y = list(enumerate(X))
Y.sort(key=lambda x: x[1])
mid = [Y[N // 2 - 1][1], Y[N // 2][1]]
ans = [-1] * N
for i, y in Y:
    if y <= mid[0]:
        ans[i] = mid[1]
    else:
        ans[i] = mid[0]
print(*ans, sep="\n")

N = int(eval(input()))
X = list(map(int, input().split()))
Y = sorted(X)
m1, m2 = Y[N // 2 - 1], Y[N // 2]
for x in X:
    if x <= m1:
        print(m2)
    else:
        print(m1)

-N = int(input()) +N = int(eval(input())) -Y = list(enumerate(X)) -Y.sort(key=lambda x: x[1]) -mid = [Y[N // 2 - 1][1], Y[N // 2][1]] -ans = [-1] * N -for i, y in Y: -    if y <= mid[0]: -        ans[i] = mid[1] +Y = sorted(X) +m1, m2 = Y[N // 2 - 1], Y[N // 2] +for x in X: +    if x <= m1: +        print(m2) -        ans[i] = mid[0] -print(*ans, sep="\n") +        print(m1)