N = int(eval(input()))

X = [int(i) for i in input().split()]

X_sorted = sorted(X)

X_med = X_sorted[N//2-1:N//2+1]

for xi in X: print((X_med[1] if xi<=X_med[0] else X_med[0]))
N = int(eval(input()))

X = [int(i) for i in input().split()]

X_med = sorted(X)[N//2-1:N//2+1]

print(("\n".join(map(str, [X_med[1] if xi<=X_med[0] else X_med[0] for xi in X]))))
N = int(eval(input()))
X = [int(i) for i in input().split()]
X_sorted = sorted(X)
X_med = X_sorted[N // 2 - 1 : N // 2 + 1]
for xi in X:
    print((X_med[1] if xi <= X_med[0] else X_med[0]))

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

-X_sorted = sorted(X) -X_med = X_sorted[N // 2 - 1 : N // 2 + 1] -for xi in X: -    print((X_med[1] if xi <= X_med[0] else X_med[0])) +X_med = sorted(X)[N // 2 - 1 : N // 2 + 1] +print(("\n".join(map(str, [X_med[1] if xi <= X_med[0] else X_med[0] for xi in X]))))