import sys

def input(): return sys.stdin.readline().strip()



def resolve():

    n=int(eval(input()))

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

    l2=sorted(l)

    x=l2[n//2-1]

    y=l2[n//2]

    if x==y:

        for i in range(n):

            print(x)

    else:

        setx=set(l2[:n//2])

        sety=set(l2[n//2:])

        for i in l:

            if i in setx:

                print(y)

            else:

                print(x)

resolve()
import sys





def input(): return sys.stdin.readline().strip()





def resolve():

    n = int(eval(input()))

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

    lsort = sorted(l)

    left = lsort[n // 2 - 1]

    right = lsort[n // 2]

    for i in l:

        if i <= left:

            print(right)

        else:

            print(left)

resolve()
import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    n = int(eval(input()))
    l = list(map(int, input().split()))
    l2 = sorted(l)
    x = l2[n // 2 - 1]
    y = l2[n // 2]
    if x == y:
        for i in range(n):
            print(x)
    else:
        setx = set(l2[: n // 2])
        sety = set(l2[n // 2 :])
        for i in l:
            if i in setx:
                print(y)
            else:
                print(x)


resolve()

import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    n = int(eval(input()))
    l = list(map(int, input().split()))
    lsort = sorted(l)
    left = lsort[n // 2 - 1]
    right = lsort[n // 2]
    for i in l:
        if i <= left:
            print(right)
        else:
            print(left)


resolve()

-    l2 = sorted(l) -    x = l2[n // 2 - 1] -    y = l2[n // 2] -    if x == y: -        for i in range(n): -            print(x) -    else: -        setx = set(l2[: n // 2]) -        sety = set(l2[n // 2 :]) -        for i in l: -            if i in setx: -                print(y) -            else: -                print(x) +    lsort = sorted(l) +    left = lsort[n // 2 - 1] +    right = lsort[n // 2] +    for i in l: +        if i <= left: +            print(right) +        else: +            print(left)