# encoding:utf-8

import copy

import numpy as np

import random



n = int(eval(input()))

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



x_sorted = sorted(x)



middle = n//2

middle_num = x_sorted[middle]

for i in range(n):

    if x[i] < middle_num:

        print((x_sorted[middle]))

    else:

        print((x_sorted[middle-1]))

#!/usr/bin/env python3

# encoding:utf-8

import copy

import random

import bisect #bisect_left　これで二部探索の大小検索が行える

import fractions #最小公倍数などはこっち

import math

import sys

import collections

from decimal import Decimal # 10進数で考慮できる



mod = 10**9+7

sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000



d = collections.deque()

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



N = int(eval(input()))

X = LI()



X_sort = sorted(X)

# X.sort()



mid = X_sort[N // 2]



for i in range(N):

    if X[i] < mid:

        print((X_sort[N // 2]))

    else:

        print((X_sort[N // 2 - 1]))



    

# encoding:utf-8
import copy
import numpy as np
import random

n = int(eval(input()))
x = [int(i) for i in input().split()]
x_sorted = sorted(x)
middle = n // 2
middle_num = x_sorted[middle]
for i in range(n):
    if x[i] < middle_num:
        print((x_sorted[middle]))
    else:
        print((x_sorted[middle - 1]))

#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect  # bisect_left　これで二部探索の大小検索が行える
import fractions  # 最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal  # 10進数で考慮できる

mod = 10**9 + 7
sys.setrecursionlimit(mod)  # 再帰回数上限はでdefault1000
d = collections.deque()


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


N = int(eval(input()))
X = LI()
X_sort = sorted(X)
# X.sort()
mid = X_sort[N // 2]
for i in range(N):
    if X[i] < mid:
        print((X_sort[N // 2]))
    else:
        print((X_sort[N // 2 - 1]))

+#!/usr/bin/env python3 -import numpy as np +import bisect  # bisect_left　これで二部探索の大小検索が行える +import fractions  # 最小公倍数などはこっち +import math +import sys +import collections +from decimal import Decimal  # 10進数で考慮できる -n = int(eval(input())) -x = [int(i) for i in input().split()] -x_sorted = sorted(x) -middle = n // 2 -middle_num = x_sorted[middle] -for i in range(n): -    if x[i] < middle_num: -        print((x_sorted[middle])) +mod = 10**9 + 7 +sys.setrecursionlimit(mod)  # 再帰回数上限はでdefault1000 +d = collections.deque() + + +def LI(): +    return list(map(int, sys.stdin.readline().split())) + + +N = int(eval(input())) +X = LI() +X_sort = sorted(X) +# X.sort() +mid = X_sort[N // 2] +for i in range(N): +    if X[i] < mid: +        print((X_sort[N // 2])) -        print((x_sorted[middle - 1])) +        print((X_sort[N // 2 - 1]))