#!/usr/bin/env python3

import sys, math, itertools, heapq, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

sys.setrecursionlimit(10**8)

inf = float('inf')

ans = count = 0



n=int(eval(input()))

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

X=sorted(Y)

X0=X[n//2-1]

X1=X[n//2]

for i in  range(n):

    if Y[i]<=X0:

        print(X1)

    else:

        print(X0)



#!/usr/bin/env python3

import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

inf = float('inf') ;mod = 10**9+7

mans = inf ;ans = 0 ;count = 0 ;pro = 1



n = int(eval(input()))

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

Y = sorted(X)

a = Y[n//2-1]

b = Y[n//2]

for  xi in X:

  if xi <= a:print(b)

  else:

    print(a)
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
sys.setrecursionlimit(10**8)
inf = float("inf")
ans = count = 0
n = int(eval(input()))
Y = list(map(int, input().split()))
X = sorted(Y)
X0 = X[n // 2 - 1]
X1 = X[n // 2]
for i in range(n):
    if Y[i] <= X0:
        print(X1)
    else:
        print(X0)

#!/usr/bin/env python3
import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
inf = float("inf")
mod = 10**9 + 7
mans = inf
ans = 0
count = 0
pro = 1
n = int(eval(input()))
X = list(map(int, input().split()))
Y = sorted(X)
a = Y[n // 2 - 1]
b = Y[n // 2]
for xi in X:
    if xi <= a:
        print(b)
    else:
        print(a)

-import sys, math, itertools, heapq, collections, bisect +import sys, math, itertools, collections, bisect -sys.setrecursionlimit(10**8) -ans = count = 0 +mod = 10**9 + 7 +mans = inf +ans = 0 +count = 0 +pro = 1 -Y = list(map(int, input().split())) -X = sorted(Y) -X0 = X[n // 2 - 1] -X1 = X[n // 2] -for i in range(n): -    if Y[i] <= X0: -        print(X1) +X = list(map(int, input().split())) +Y = sorted(X) +a = Y[n // 2 - 1] +b = Y[n // 2] +for xi in X: +    if xi <= a: +        print(b) -        print(X0) +        print(a)