N = int(input())

X = []

for i, x in enumerate(map(int, input().split())):

    X.append((x, i))



X.sort()

Y = [0] * N

for j, (x, i) in enumerate(X):

    Y[i] = j



mid = N / 2

l = X[N // 2 - 1][0]

r = X[N // 2][0]

ans = []

for j in Y:

    if j < mid:

        ans.append(r)

    else:

        ans.append(l)



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

N = int(eval(input()))

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

order = {}

for idx, x in enumerate(X):

    order[idx] = x



X.sort()

m = N // 2

l = X[m - 1]

r = X[m]



for idx in range(N):

    x = order[idx]

    if x <= l:

        print(r)

    else:

        print(l)

N = int(input())
X = []
for i, x in enumerate(map(int, input().split())):
    X.append((x, i))
X.sort()
Y = [0] * N
for j, (x, i) in enumerate(X):
    Y[i] = j
mid = N / 2
l = X[N // 2 - 1][0]
r = X[N // 2][0]
ans = []
for j in Y:
    if j < mid:
        ans.append(r)
    else:
        ans.append(l)
print(*ans, sep="\n")

N = int(eval(input()))
X = list(map(int, input().split()))
order = {}
for idx, x in enumerate(X):
    order[idx] = x
X.sort()
m = N // 2
l = X[m - 1]
r = X[m]
for idx in range(N):
    x = order[idx]
    if x <= l:
        print(r)
    else:
        print(l)

-N = int(input()) -X = [] -for i, x in enumerate(map(int, input().split())): -    X.append((x, i)) +N = int(eval(input())) +X = list(map(int, input().split())) +order = {} +for idx, x in enumerate(X): +    order[idx] = x -Y = [0] * N -for j, (x, i) in enumerate(X): -    Y[i] = j -mid = N / 2 -l = X[N // 2 - 1][0] -r = X[N // 2][0] -ans = [] -for j in Y: -    if j < mid: -        ans.append(r) +m = N // 2 +l = X[m - 1] +r = X[m] +for idx in range(N): +    x = order[idx] +    if x <= l: +        print(r) -        ans.append(l) -print(*ans, sep="\n") +        print(l)