n = int(eval(input()))

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

sortA = sorted(A)



for i in range(n):

    if A[i] <= sortA[(n // 2) - 1]:

        print((sortA[n // 2]))

    else:

        print((sortA[(n // 2) - 1]))
n = int(eval(input()))

A = [int(i) for i in input().split()]



sortA = sorted(A)

mid = sortA[n//2 - 1]

midnext = sortA[n//2]



for i in range(n):

    if A[i] <= mid:

        print(midnext)

    else:

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

n = int(eval(input()))
A = [int(i) for i in input().split()]
sortA = sorted(A)
mid = sortA[n // 2 - 1]
midnext = sortA[n // 2]
for i in range(n):
    if A[i] <= mid:
        print(midnext)
    else:
        print(mid)

-A = list(map(int, input().split())) +A = [int(i) for i in input().split()] +mid = sortA[n // 2 - 1] +midnext = sortA[n // 2] -    if A[i] <= sortA[(n // 2) - 1]: -        print((sortA[n // 2])) +    if A[i] <= mid: +        print(midnext) -        print((sortA[(n // 2) - 1])) +        print(mid)