import bisect



n = int(eval(input()))

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



sorted_x = sorted(X)



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



for x in X:

    if bisect.bisect_left(sorted_x, x) < n // 2:

        print(l)

    else:

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

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



sorted_x = sorted(X)



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



for x in X:

    if x < r:

        print(r)

    else:

        print(l)
import bisect

n = int(eval(input()))
X = list(map(int, input().split()))
sorted_x = sorted(X)
l, r = sorted_x[n // 2], sorted_x[n // 2 - 1]
for x in X:
    if bisect.bisect_left(sorted_x, x) < n // 2:
        print(l)
    else:
        print(r)

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

-import bisect - -l, r = sorted_x[n // 2], sorted_x[n // 2 - 1] +l, r = sorted_x[n // 2 - 1], sorted_x[n // 2] -    if bisect.bisect_left(sorted_x, x) < n // 2: +    if x < r: +        print(r) +    else: -    else: -        print(r)