N = int(eval(input()))

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

SX = sorted(X)

m1,m2 = SX[N//2-1],SX[N//2]



for a in X:

    print((m2 if a <= m1 else m1))
N = int(input())

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



sx = list(sorted(X))

m1 = sx[N//2 - 1]

m2 = sx[N//2]



ans = []

for a in X:

    if a >= m2:

        ans.append(m1)

    else:

        ans.append(m2)

print(*ans, sep='\n')

N = int(eval(input()))
X = list(map(int, input().split()))
SX = sorted(X)
m1, m2 = SX[N // 2 - 1], SX[N // 2]
for a in X:
    print((m2 if a <= m1 else m1))

N = int(input())
X = list(map(int, input().split()))
sx = list(sorted(X))
m1 = sx[N // 2 - 1]
m2 = sx[N // 2]
ans = []
for a in X:
    if a >= m2:
        ans.append(m1)
    else:
        ans.append(m2)
print(*ans, sep="\n")

-N = int(eval(input())) +N = int(input()) -SX = sorted(X) -m1, m2 = SX[N // 2 - 1], SX[N // 2] +sx = list(sorted(X)) +m1 = sx[N // 2 - 1] +m2 = sx[N // 2] +ans = [] -    print((m2 if a <= m1 else m1)) +    if a >= m2: +        ans.append(m1) +    else: +        ans.append(m2) +print(*ans, sep="\n")