import copy



n = int(eval(input()))

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

sortedx = copy.copy(x)

sortedx.sort()



m = sortedx[int((n+1)/2)]



for i in x:

    if i < m:

        print((sortedx[int(n/2)]))

    else:

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

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

sortedx = sorted(x)

r = sortedx[n//2]

l = sortedx[n//2-1]



for i in x:

    if i < r:

        print(r)

    else:

        print(l)
import copy

n = int(eval(input()))
x = [int(i) for i in input().split()]
sortedx = copy.copy(x)
sortedx.sort()
m = sortedx[int((n + 1) / 2)]
for i in x:
    if i < m:
        print((sortedx[int(n / 2)]))
    else:
        print((sortedx[int(n / 2 - 1)]))

n = int(eval(input()))
x = [int(i) for i in input().split()]
sortedx = sorted(x)
r = sortedx[n // 2]
l = sortedx[n // 2 - 1]
for i in x:
    if i < r:
        print(r)
    else:
        print(l)

-import copy - -sortedx = copy.copy(x) -sortedx.sort() -m = sortedx[int((n + 1) / 2)] +sortedx = sorted(x) +r = sortedx[n // 2] +l = sortedx[n // 2 - 1] -    if i < m: -        print((sortedx[int(n / 2)])) +    if i < r: +        print(r) -        print((sortedx[int(n / 2 - 1)])) +        print(l)