N = int(input())

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



mid1, mid2 = sorted(X)[N//2-1:N//2+1]

print(*[mid1 if xi>mid1 else mid2 for xi in X], sep="\n")

N = int(eval(input()))

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



mid1, mid2 = sorted(X)[N//2-1:N//2+1]

print(('\n'.join(str(mid1) if xi>mid1 else str(mid2) for xi in X)))

N = int(input())
X = list(map(int, input().split()))
mid1, mid2 = sorted(X)[N // 2 - 1 : N // 2 + 1]
print(*[mid1 if xi > mid1 else mid2 for xi in X], sep="\n")

N = int(eval(input()))
X = list(map(int, input().split()))
mid1, mid2 = sorted(X)[N // 2 - 1 : N // 2 + 1]
print(("\n".join(str(mid1) if xi > mid1 else str(mid2) for xi in X)))

-N = int(input()) +N = int(eval(input())) -print(*[mid1 if xi > mid1 else mid2 for xi in X], sep="\n") +print(("\n".join(str(mid1) if xi > mid1 else str(mid2) for xi in X)))