# ARC095C - Many Medians (ABC094C)

def main():

    n = int(eval(input()))

    x = list(map(int, input().rstrip().split()))

    l, h = sorted(x)[n // 2 - 1 : n // 2 + 1]

    for i in x:

        if i <= l:

            print(h)

        else:

            print(l)





if __name__ == "__main__":

    main()
# ARC095C - Many Medians (ABC094C)

def main():

    n = int(eval(input()))

    x = tuple(map(int, input().rstrip().split()))

    l, h = sorted(x)[n // 2 - 1 : n // 2 + 1]

    for i in x:

        if i <= l:

            print(h)

        else:

            print(l)





if __name__ == "__main__":

    main()
# ARC095C - Many Medians (ABC094C)
def main():
    n = int(eval(input()))
    x = list(map(int, input().rstrip().split()))
    l, h = sorted(x)[n // 2 - 1 : n // 2 + 1]
    for i in x:
        if i <= l:
            print(h)
        else:
            print(l)


if __name__ == "__main__":
    main()

# ARC095C - Many Medians (ABC094C)
def main():
    n = int(eval(input()))
    x = tuple(map(int, input().rstrip().split()))
    l, h = sorted(x)[n // 2 - 1 : n // 2 + 1]
    for i in x:
        if i <= l:
            print(h)
        else:
            print(l)


if __name__ == "__main__":
    main()

-    x = list(map(int, input().rstrip().split())) +    x = tuple(map(int, input().rstrip().split()))