N = int(eval(input()))

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

X = sorted(A,reverse=False)



for i in range(N):

    if A[i] < X[N//2 ]:

        print((X[N//2 ]))

    else:

        print((X[N//2 - 1]))

N = int(eval(input()))

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



B = sorted(A)

X = B[N//2-1]

Y = B[N//2]



for i in range(N):

    if A[i] <= X:

        print(Y)

    else:

        print(X)
N = int(eval(input()))
A = list(map(int, input().split()))
X = sorted(A, reverse=False)
for i in range(N):
    if A[i] < X[N // 2]:
        print((X[N // 2]))
    else:
        print((X[N // 2 - 1]))

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

-X = sorted(A, reverse=False) +B = sorted(A) +X = B[N // 2 - 1] +Y = B[N // 2] -    if A[i] < X[N // 2]: -        print((X[N // 2])) +    if A[i] <= X: +        print(Y) -        print((X[N // 2 - 1])) +        print(X)