n = int(eval(input()))

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

ls2 = ls.copy()

ls2.sort()

m = ls2[n // 2]

for i in range(n):

    if ls[i] < m:

        print(m)

    else:

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

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

ls2 = sorted(ls)

m0 = ls2[n // 2 - 1]

m1 = ls2[n // 2]

for x in ls:

    if x < m1:

        print(m1)

    else:

        print(m0)
n = int(eval(input()))
ls = list(map(int, input().split()))
ls2 = ls.copy()
ls2.sort()
m = ls2[n // 2]
for i in range(n):
    if ls[i] < m:
        print(m)
    else:
        print((ls2[n // 2 - 1]))

n = int(eval(input()))
ls = list(map(int, input().split()))
ls2 = sorted(ls)
m0 = ls2[n // 2 - 1]
m1 = ls2[n // 2]
for x in ls:
    if x < m1:
        print(m1)
    else:
        print(m0)

-ls2 = ls.copy() -ls2.sort() -m = ls2[n // 2] -for i in range(n): -    if ls[i] < m: -        print(m) +ls2 = sorted(ls) +m0 = ls2[n // 2 - 1] +m1 = ls2[n // 2] +for x in ls: +    if x < m1: +        print(m1) -        print((ls2[n // 2 - 1])) +        print(m0)