n = int(eval(input()))

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



sortedx = x[:]

sortedx.sort()



for i in range(n):

    #ix = sortedx.index(x[i])

    #print(sortedx)

    #print(ix)

    if x[i] <= sortedx[n//2-1]:

        print((sortedx[n//2]))

    else:

        print((sortedx[n//2-1]))
n = int(eval(input()))

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

     

sx = sorted(x)

xm = sx[n//2-1]

xp = sx[n//2]

     

for i in range(n):

    if x[i] <= xm:

        b = xp

    else:

        b = xm

    print(b)
n = int(eval(input()))
x = list(map(int, input().split()))
sortedx = x[:]
sortedx.sort()
for i in range(n):
    # ix = sortedx.index(x[i])
    # print(sortedx)
    # print(ix)
    if x[i] <= sortedx[n // 2 - 1]:
        print((sortedx[n // 2]))
    else:
        print((sortedx[n // 2 - 1]))

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

-sortedx = x[:] -sortedx.sort() +sx = sorted(x) +xm = sx[n // 2 - 1] +xp = sx[n // 2] -    # ix = sortedx.index(x[i]) -    # print(sortedx) -    # print(ix) -    if x[i] <= sortedx[n // 2 - 1]: -        print((sortedx[n // 2])) +    if x[i] <= xm: +        b = xp -        print((sortedx[n // 2 - 1])) +        b = xm +    print(b)