from collections import Counter,defaultdict,deque

import sys,heapq,bisect,math,itertools,string,queue

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



n = inp()

a = inpl()

b = sorted(a)

l,r = b[n//2-1],b[n//2]

for i in a:

    if i <= l:

        print(r)

    else:

        print(l)
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n = inp()

a = inpl()

b = sorted(a)

mi = b[n//2-1]

ma = b[n//2]

for x in a:

    print((ma if x <= mi else mi))
from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpl_str():
    return list(sys.stdin.readline().split())


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


n = inp()
a = inpl()
b = sorted(a)
l, r = b[n // 2 - 1], b[n // 2]
for i in a:
    if i <= l:
        print(r)
    else:
        print(l)

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n = inp()
a = inpl()
b = sorted(a)
mi = b[n // 2 - 1]
ma = b[n // 2]
for x in a:
    print((ma if x <= mi else mi))

-import sys, heapq, bisect, math, itertools, string, queue +from heapq import heappop, heappush +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint +INF = float("inf") -def inpl_str(): -    return list(sys.stdin.readline().split()) - - -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -l, r = b[n // 2 - 1], b[n // 2] -for i in a: -    if i <= l: -        print(r) -    else: -        print(l) +mi = b[n // 2 - 1] +ma = b[n // 2] +for x in a: +    print((ma if x <= mi else mi))