import copy

n=int(eval(input()))



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



t2 = copy.copy(t1)



t2.sort()



for i in t1:

    if i <= t2[(n//2)-1]:

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

    else:

        print((t2[(n//2)-1]))
import copy



n=int(eval(input()))



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



x2 = copy.copy(x)



x2.sort()



ans = [x2[n//2-1],x2[n//2]]



for xx in x:

    if xx <= ans[0]:

        print((ans[1]))

    else:

        print((ans[0]))
import copy

n = int(eval(input()))
t1 = list(map(int, input().split()))
t2 = copy.copy(t1)
t2.sort()
for i in t1:
    if i <= t2[(n // 2) - 1]:
        print((t2[(n // 2)]))
    else:
        print((t2[(n // 2) - 1]))

import copy

n = int(eval(input()))
x = list(map(int, input().split()))
x2 = copy.copy(x)
x2.sort()
ans = [x2[n // 2 - 1], x2[n // 2]]
for xx in x:
    if xx <= ans[0]:
        print((ans[1]))
    else:
        print((ans[0]))

-t1 = list(map(int, input().split())) -t2 = copy.copy(t1) -t2.sort() -for i in t1: -    if i <= t2[(n // 2) - 1]: -        print((t2[(n // 2)])) +x = list(map(int, input().split())) +x2 = copy.copy(x) +x2.sort() +ans = [x2[n // 2 - 1], x2[n // 2]] +for xx in x: +    if xx <= ans[0]: +        print((ans[1])) -        print((t2[(n // 2) - 1])) +        print((ans[0]))