n = int(eval(input()))

x = list(enumerate(map(int, input().split())))

x.sort(key=lambda x:x[1])

ans = [""]*n

for i in range(n):

  if (n+1)//2 >= i+1: ans[x[i][0]] = x[(n+1)//2][1]

  else: ans[x[i][0]] = x[(n+1)//2-1][1]



print(("\n".join(map(str, ans))))
n = int(eval(input()))

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

x = sorted(X)

l = x[n//2-1]

r = x[n//2]

for i in range(n):

    if X[i] <= l:

        print(r)

    else:

        print(l)
n = int(eval(input()))
x = list(enumerate(map(int, input().split())))
x.sort(key=lambda x: x[1])
ans = [""] * n
for i in range(n):
    if (n + 1) // 2 >= i + 1:
        ans[x[i][0]] = x[(n + 1) // 2][1]
    else:
        ans[x[i][0]] = x[(n + 1) // 2 - 1][1]
print(("\n".join(map(str, ans))))

n = int(eval(input()))
X = list(map(int, input().split()))
x = sorted(X)
l = x[n // 2 - 1]
r = x[n // 2]
for i in range(n):
    if X[i] <= l:
        print(r)
    else:
        print(l)

-x = list(enumerate(map(int, input().split()))) -x.sort(key=lambda x: x[1]) -ans = [""] * n +X = list(map(int, input().split())) +x = sorted(X) +l = x[n // 2 - 1] +r = x[n // 2] -    if (n + 1) // 2 >= i + 1: -        ans[x[i][0]] = x[(n + 1) // 2][1] +    if X[i] <= l: +        print(r) -        ans[x[i][0]] = x[(n + 1) // 2 - 1][1] -print(("\n".join(map(str, ans)))) +        print(l)