n = int(eval(input()))

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



sx = sorted(x)

m = (n+1)//2

med1 = sx[m - 1]

med2 = sx[m]



for _x in x:

    if _x <= med1:

        print(med2)

    else:

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

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

x_ = sorted(x)

c = x_[n//2 - 1]

c_ = x_[n//2]



for i in range(n):

    if x[i] <= c:

        print(c_)

    else:

        print(c)
n = int(eval(input()))
x = list(map(int, input().split()))
sx = sorted(x)
m = (n + 1) // 2
med1 = sx[m - 1]
med2 = sx[m]
for _x in x:
    if _x <= med1:
        print(med2)
    else:
        print(med1)

n = int(eval(input()))
x = list(map(int, input().split()))
x_ = sorted(x)
c = x_[n // 2 - 1]
c_ = x_[n // 2]
for i in range(n):
    if x[i] <= c:
        print(c_)
    else:
        print(c)

-sx = sorted(x) -m = (n + 1) // 2 -med1 = sx[m - 1] -med2 = sx[m] -for _x in x: -    if _x <= med1: -        print(med2) +x_ = sorted(x) +c = x_[n // 2 - 1] +c_ = x_[n // 2] +for i in range(n): +    if x[i] <= c: +        print(c_) -        print(med1) +        print(c)