N = int(eval(input()))

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

A = sorted(X[:])

B = A[N//2-1]

for i in range(N):

    if X[i]>B:

        print(B)

    else:

        print((A[N//2]))
N = int(eval(input()))

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

Y = sorted(X[:])

Y1 = Y[N//2-1]

Y2 = Y[N//2]

for i in range(N):

    if X[i]>Y1:

        print(Y1)

    else:

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

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

-A = sorted(X[:]) -B = A[N // 2 - 1] +Y = sorted(X[:]) +Y1 = Y[N // 2 - 1] +Y2 = Y[N // 2] -    if X[i] > B: -        print(B) +    if X[i] > Y1: +        print(Y1) -        print((A[N // 2])) +        print(Y2)