n = int(eval(input()))

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

x_sorted = sorted(x)



cs = x_sorted[n // 2 - 1]

cb = x_sorted[n // 2]



for i, v in enumerate(x):

    if v <= cs:

        print(cb)

    else:

        print(cs)
n = int(eval(input()))

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

sort_x = sorted(X)



smaller = sort_x[n//2-1]

bigger = sort_x[n//2]



for x in X:

    if x <= smaller:

        print(bigger)

    else:

        print(smaller)
n = int(eval(input()))
x = list(map(int, input().split()))
x_sorted = sorted(x)
cs = x_sorted[n // 2 - 1]
cb = x_sorted[n // 2]
for i, v in enumerate(x):
    if v <= cs:
        print(cb)
    else:
        print(cs)

n = int(eval(input()))
X = list(map(int, input().split()))
sort_x = sorted(X)
smaller = sort_x[n // 2 - 1]
bigger = sort_x[n // 2]
for x in X:
    if x <= smaller:
        print(bigger)
    else:
        print(smaller)

-x = list(map(int, input().split())) -x_sorted = sorted(x) -cs = x_sorted[n // 2 - 1] -cb = x_sorted[n // 2] -for i, v in enumerate(x): -    if v <= cs: -        print(cb) +X = list(map(int, input().split())) +sort_x = sorted(X) +smaller = sort_x[n // 2 - 1] +bigger = sort_x[n // 2] +for x in X: +    if x <= smaller: +        print(bigger) -        print(cs) +        print(smaller)