N = int(eval(input()))

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

Y = [[X[k],k] for k in range(N)]

Y.sort()

A = [0 for k in range(N)]



for k in range(N):

    if k >= N//2:

        A[Y[k][1]] = Y[N//2-1][0]

    else:

        A[Y[k][1]] = Y[N//2][0]



for x in A:

    print(x)
N = int(eval(input()))

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

Y = sorted(X)

M = (Y[N//2-1]+Y[N//2])/2

for x in X:

    if x < M:

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

    else:

        print((Y[N//2-1]))
N = int(eval(input()))
X = list(map(int, input().split()))
Y = [[X[k], k] for k in range(N)]
Y.sort()
A = [0 for k in range(N)]
for k in range(N):
    if k >= N // 2:
        A[Y[k][1]] = Y[N // 2 - 1][0]
    else:
        A[Y[k][1]] = Y[N // 2][0]
for x in A:
    print(x)

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

-Y = [[X[k], k] for k in range(N)] -Y.sort() -A = [0 for k in range(N)] -for k in range(N): -    if k >= N // 2: -        A[Y[k][1]] = Y[N // 2 - 1][0] +Y = sorted(X) +M = (Y[N // 2 - 1] + Y[N // 2]) / 2 +for x in X: +    if x < M: +        print((Y[N // 2])) -        A[Y[k][1]] = Y[N // 2][0] -for x in A: -    print(x) +        print((Y[N // 2 - 1]))