n=int(eval(input()))

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

d=sorted(x)

b1=d[len(x)//2-1]

b2=d[len(x)//2]

for i in x:

  if i<=b1:

    print(b2)

  elif i>=b2:

    print(b1)



n=int(eval(input()))

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

ans=sorted(x)

ans2=ans[n//2-1]

ans1=ans[n//2]



for i in range(n):

  if x[i]>=ans[n//2]:

    print(ans2)

  else:

    print(ans1)

    
n = int(eval(input()))
x = list(map(int, input().split()))
d = sorted(x)
b1 = d[len(x) // 2 - 1]
b2 = d[len(x) // 2]
for i in x:
    if i <= b1:
        print(b2)
    elif i >= b2:
        print(b1)

n = int(eval(input()))
x = list(map(int, input().split()))
ans = sorted(x)
ans2 = ans[n // 2 - 1]
ans1 = ans[n // 2]
for i in range(n):
    if x[i] >= ans[n // 2]:
        print(ans2)
    else:
        print(ans1)

-d = sorted(x) -b1 = d[len(x) // 2 - 1] -b2 = d[len(x) // 2] -for i in x: -    if i <= b1: -        print(b2) -    elif i >= b2: -        print(b1) +ans = sorted(x) +ans2 = ans[n // 2 - 1] +ans1 = ans[n // 2] +for i in range(n): +    if x[i] >= ans[n // 2]: +        print(ans2) +    else: +        print(ans1)