N = int(eval(input()))

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

big = sorted(a)[N // 2]

sma = sorted(a)[N // 2 - 1]

if big == sma:

    for i in range(N):

        print(big)

else:

    for i in a:

        if i < big:

            print(big)

        else:

            print(sma)
N = int(eval(input()))

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

x = sorted(X)

num1 = x[N//2]

num2 = x[N//2 - 1]

ans = []

for i in X:

    if i <= num2:

        ans.append(num1)

    else:

        ans.append(num2)

for i in ans:

    print(i)
N = int(eval(input()))
a = [int(i) for i in input().split()]
big = sorted(a)[N // 2]
sma = sorted(a)[N // 2 - 1]
if big == sma:
    for i in range(N):
        print(big)
else:
    for i in a:
        if i < big:
            print(big)
        else:
            print(sma)

N = int(eval(input()))
X = [int(i) for i in input().split()]
x = sorted(X)
num1 = x[N // 2]
num2 = x[N // 2 - 1]
ans = []
for i in X:
    if i <= num2:
        ans.append(num1)
    else:
        ans.append(num2)
for i in ans:
    print(i)

-a = [int(i) for i in input().split()] -big = sorted(a)[N // 2] -sma = sorted(a)[N // 2 - 1] -if big == sma: -    for i in range(N): -        print(big) -else: -    for i in a: -        if i < big: -            print(big) -        else: -            print(sma) +X = [int(i) for i in input().split()] +x = sorted(X) +num1 = x[N // 2] +num2 = x[N // 2 - 1] +ans = [] +for i in X: +    if i <= num2: +        ans.append(num1) +    else: +        ans.append(num2) +for i in ans: +    print(i)