from statistics import *

N = int(eval(input()))

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

Y = sorted(X)

m = median(X)



for x in X:

  if x<=m:

    print((Y[N//2]))

  else:

    print((Y[N//2-1]))
N = int(eval(input()))

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

Y = sorted(X)

m1 = Y[N//2-1]

m2 = Y[N//2]



for x in X:

  if x<m2:

    print(m2)

  else:

    print(m1)
from statistics import *

N = int(eval(input()))
X = list(map(int, input().split()))
Y = sorted(X)
m = median(X)
for x in X:
    if x <= m:
        print((Y[N // 2]))
    else:
        print((Y[N // 2 - 1]))

N = int(eval(input()))
X = list(map(int, input().split()))
Y = sorted(X)
m1 = Y[N // 2 - 1]
m2 = Y[N // 2]
for x in X:
    if x < m2:
        print(m2)
    else:
        print(m1)

-from statistics import * - -m = median(X) +m1 = Y[N // 2 - 1] +m2 = Y[N // 2] -    if x <= m: -        print((Y[N // 2])) +    if x < m2: +        print(m2) -        print((Y[N // 2 - 1])) +        print(m1)