n,*x=list(map(int,open(0).read().split()))

y=sorted(x)

a,b=y[n//2],y[n//2-1]

for i in x:print((a*(i<=b)or b))
n,*x=list(map(int,open(0).read().split()))

y=sorted(x)[n//2-1:n//2+1]

for i in x:print((y[i<=y[0]]))
n, *x = list(map(int, open(0).read().split()))
y = sorted(x)
a, b = y[n // 2], y[n // 2 - 1]
for i in x:
    print((a * (i <= b) or b))

n, *x = list(map(int, open(0).read().split()))
y = sorted(x)[n // 2 - 1 : n // 2 + 1]
for i in x:
    print((y[i <= y[0]]))

-y = sorted(x) -a, b = y[n // 2], y[n // 2 - 1] +y = sorted(x)[n // 2 - 1 : n // 2 + 1] -    print((a * (i <= b) or b)) +    print((y[i <= y[0]]))