import sys

import bisect

sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    n = int(eval(input()))

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

    X_s = sorted(X)



    for i in range(n):

        idx = bisect.bisect_left(X_s, X[i])

        if idx <= n // 2 - 1:

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

        else:

            print((X_s[n // 2 - 1]))





if __name__ == '__main__':

    resolve()

import sys



sys.setrecursionlimit(10 ** 7)

input = sys.stdin.readline

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    n = int(input())

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

    for i in range(n):

        x = X[i]

        X[i] = [i, x]

    X_s = sorted(X, key=lambda x: x[1])



    res = [0] * n

    for i in range(n):

        idx, _ = X_s[i]

        if i < n // 2:

            res[idx] = X_s[n // 2][1]

        else:

            res[idx] = X_s[n // 2 - 1][1]



    print(*res, sep="\n")





if __name__ == '__main__':

    resolve()

import sys
import bisect

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


def resolve():
    n = int(eval(input()))
    X = list(map(int, input().split()))
    X_s = sorted(X)
    for i in range(n):
        idx = bisect.bisect_left(X_s, X[i])
        if idx <= n // 2 - 1:
            print((X_s[n // 2]))
        else:
            print((X_s[n // 2 - 1]))


if __name__ == "__main__":
    resolve()

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    n = int(input())
    X = list(map(int, input().split()))
    for i in range(n):
        x = X[i]
        X[i] = [i, x]
    X_s = sorted(X, key=lambda x: x[1])
    res = [0] * n
    for i in range(n):
        idx, _ = X_s[i]
        if i < n // 2:
            res[idx] = X_s[n // 2][1]
        else:
            res[idx] = X_s[n // 2 - 1][1]
    print(*res, sep="\n")


if __name__ == "__main__":
    resolve()

-import bisect +input = sys.stdin.readline -    n = int(eval(input())) +    n = int(input()) -    X_s = sorted(X) -        idx = bisect.bisect_left(X_s, X[i]) -        if idx <= n // 2 - 1: -            print((X_s[n // 2])) +        x = X[i] +        X[i] = [i, x] +    X_s = sorted(X, key=lambda x: x[1]) +    res = [0] * n +    for i in range(n): +        idx, _ = X_s[i] +        if i < n // 2: +            res[idx] = X_s[n // 2][1] -            print((X_s[n // 2 - 1])) +            res[idx] = X_s[n // 2 - 1][1] +    print(*res, sep="\n")