from statistics import mean, median,variance,stdev

n=int(eval(input()))

nn=n//2

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

y=x[:]

x.sort()



low_median=median(x[:n-1])

high_median=median(x[1:])



for i in range(n):

  if y[i]<high_median:

    print(high_median)

  else:

    print(low_median)
n=int(eval(input()))

nn=n//2

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

y=x[:]

x.sort()

 

low_median=x[nn-1]

high_median=x[nn]

 

for i in range(n):

  if y[i]<high_median:

    print(high_median)

  else:

    print(low_median)

from statistics import mean, median, variance, stdev

n = int(eval(input()))
nn = n // 2
x = [int(i) for i in input().split()]
y = x[:]
x.sort()
low_median = median(x[: n - 1])
high_median = median(x[1:])
for i in range(n):
    if y[i] < high_median:
        print(high_median)
    else:
        print(low_median)

n = int(eval(input()))
nn = n // 2
x = [int(i) for i in input().split()]
y = x[:]
x.sort()
low_median = x[nn - 1]
high_median = x[nn]
for i in range(n):
    if y[i] < high_median:
        print(high_median)
    else:
        print(low_median)

-from statistics import mean, median, variance, stdev - -low_median = median(x[: n - 1]) -high_median = median(x[1:]) +low_median = x[nn - 1] +high_median = x[nn]