m=int(eval(input()))//2-1

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

l,r=sorted(x)[m:m+2]

for i in x: print(([l,r][i<r]))
n=int(eval(input()))

x=[*list(map(int,input().split()))]

s=sorted(x)

l,r=s[n//2-1],s[n//2]

for i in x:

  print(([l,r][i<r]))
m = int(eval(input())) // 2 - 1
x = list(map(int, input().split()))
l, r = sorted(x)[m : m + 2]
for i in x:
    print(([l, r][i < r]))

n = int(eval(input()))
x = [*list(map(int, input().split()))]
s = sorted(x)
l, r = s[n // 2 - 1], s[n // 2]
for i in x:
    print(([l, r][i < r]))

-m = int(eval(input())) // 2 - 1 -x = list(map(int, input().split())) -l, r = sorted(x)[m : m + 2] +n = int(eval(input())) +x = [*list(map(int, input().split()))] +s = sorted(x) +l, r = s[n // 2 - 1], s[n // 2]