N = int(eval(input()))

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



mid = sorted(X)[N//2-1:N//2+1]

for xi in X:

    if xi > mid[0]:

        print((mid[0]))

    else:

        print((mid[1]))

N = int(input())

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



mid1, mid2 = sorted(X)[N//2-1:N//2+1]

print(*[mid1 if xi>mid1 else mid2 for xi in X], sep="\n")

N = int(eval(input()))
X = list(map(int, input().split()))
mid = sorted(X)[N // 2 - 1 : N // 2 + 1]
for xi in X:
    if xi > mid[0]:
        print((mid[0]))
    else:
        print((mid[1]))

N = int(input())
X = list(map(int, input().split()))
mid1, mid2 = sorted(X)[N // 2 - 1 : N // 2 + 1]
print(*[mid1 if xi > mid1 else mid2 for xi in X], sep="\n")

-N = int(eval(input())) +N = int(input()) -mid = sorted(X)[N // 2 - 1 : N // 2 + 1] -for xi in X: -    if xi > mid[0]: -        print((mid[0])) -    else: -        print((mid[1])) +mid1, mid2 = sorted(X)[N // 2 - 1 : N // 2 + 1] +print(*[mid1 if xi > mid1 else mid2 for xi in X], sep="\n")