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(eval(input()))

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



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

smid1 = str(mid1)

smid2 = str(mid2)

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

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

-print(("\n".join(str(mid1) if xi > mid1 else str(mid2) for xi in X))) +smid1 = str(mid1) +smid2 = str(mid2) +print(("\n".join(smid1 if xi > mid1 else smid2 for xi in X)))