N = int(eval(input()))

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

X0 = X[::]

X.sort()

num = int(N / 2 - 1)  # index は num

ans0, ans1 = X[num], X[num + 1]

for i in range(N):

    if X0[i] > ans0:

        print(ans0)

    else:

        print(ans1)

n = int(eval(input()))

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



Y = X[::]

Y.sort()



m = n // 2

median = (Y[m] + Y[m - 1]) / 2



for x in X:

    if x < median:

        print((Y[m]))

    else:

        print((Y[m-1]))



N = int(eval(input()))
X = list(map(int, input().split()))
X0 = X[::]
X.sort()
num = int(N / 2 - 1)  # index は num
ans0, ans1 = X[num], X[num + 1]
for i in range(N):
    if X0[i] > ans0:
        print(ans0)
    else:
        print(ans1)

n = int(eval(input()))
X = list(map(int, input().split()))
Y = X[::]
Y.sort()
m = n // 2
median = (Y[m] + Y[m - 1]) / 2
for x in X:
    if x < median:
        print((Y[m]))
    else:
        print((Y[m - 1]))

-N = int(eval(input())) +n = int(eval(input())) -X0 = X[::] -X.sort() -num = int(N / 2 - 1)  # index は num -ans0, ans1 = X[num], X[num + 1] -for i in range(N): -    if X0[i] > ans0: -        print(ans0) +Y = X[::] +Y.sort() +m = n // 2 +median = (Y[m] + Y[m - 1]) / 2 +for x in X: +    if x < median: +        print((Y[m])) -        print(ans1) +        print((Y[m - 1]))