N = int(eval(input()))

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

L = sorted(X)

p = L[N//2]

q = L[N//2-1]

for i in range(N) :

    if X[i] <= q :

        print(p)

    else :

        print(q)

        
N = int(input())

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



Y = sorted(X)



a = Y[N//2-1]

b = Y[N//2]



ans = []



for x in X :

    if x <= a :

        ans.append(b)

    else :

        ans.append(a)



print(*ans,sep="\n")

N = int(eval(input()))
X = list(map(int, input().split()))
L = sorted(X)
p = L[N // 2]
q = L[N // 2 - 1]
for i in range(N):
    if X[i] <= q:
        print(p)
    else:
        print(q)

N = int(input())
X = list(map(int, input().split()))
Y = sorted(X)
a = Y[N // 2 - 1]
b = Y[N // 2]
ans = []
for x in X:
    if x <= a:
        ans.append(b)
    else:
        ans.append(a)
print(*ans, sep="\n")

-N = int(eval(input())) +N = int(input()) -L = sorted(X) -p = L[N // 2] -q = L[N // 2 - 1] -for i in range(N): -    if X[i] <= q: -        print(p) +Y = sorted(X) +a = Y[N // 2 - 1] +b = Y[N // 2] +ans = [] +for x in X: +    if x <= a: +        ans.append(b) -        print(q) +        ans.append(a) +print(*ans, sep="\n")