n=int(eval(input()))

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

lr,rr=sorted(x)[n//2-1:n//2+1]

for i in x:

    print((lr if lr<i else rr))
n=int(eval(input()))

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

lr,rr=sorted(x)[n//2-1:n//2+1]

print(('\n'.join([str(lr) if lr<i else str(rr) for i in x])))
n = int(eval(input()))
x = list(map(int, input().split()))
lr, rr = sorted(x)[n // 2 - 1 : n // 2 + 1]
for i in x:
    print((lr if lr < i else rr))

n = int(eval(input()))
x = list(map(int, input().split()))
lr, rr = sorted(x)[n // 2 - 1 : n // 2 + 1]
print(("\n".join([str(lr) if lr < i else str(rr) for i in x])))

-for i in x: -    print((lr if lr < i else rr)) +print(("\n".join([str(lr) if lr < i else str(rr) for i in x])))