N = int(eval(input()))

A = [int(x) for x in input().split()]

B = sorted(A)



l = B[N//2 -1]

r = B[N//2]



for a in A:

  if a<=l:

    print(r)

  else:

    print(l)



    
N = int(eval(input()))

A = [int(x) for x in input().split()]

B = sorted(A)



l = B[N//2 -1]

r = B[N//2]



for a in A:

  if a<r:

    print(r)

  else:

    print(l)



    
N = int(eval(input()))
A = [int(x) for x in input().split()]
B = sorted(A)
l = B[N // 2 - 1]
r = B[N // 2]
for a in A:
    if a <= l:
        print(r)
    else:
        print(l)

N = int(eval(input()))
A = [int(x) for x in input().split()]
B = sorted(A)
l = B[N // 2 - 1]
r = B[N // 2]
for a in A:
    if a < r:
        print(r)
    else:
        print(l)

-    if a <= l: +    if a < r: