def main():

    n, *x = list(map(int, open(0).read().split()))

    y = sorted(x)

    a, b = y[n // 2 - 1], y[n // 2]

    d = dict()

    for i, j in enumerate(y, 1):

        if i <= n // 2:

            d[j] = b

        else:

            d[j] = a



    for i in x:

        print((d[i]))





if __name__ == '__main__':

    main()

def main():

    n, *x = list(map(int, open(0).read().split()))

    y = sorted(x)

    a, b = y[n // 2 - 1], y[n // 2]

    ans = ""

    for i in x:

        if i <= a:

            ans += str(b) + "\n"

        else:

            ans += str(a) + "\n"



    print(ans)





if __name__ == '__main__':

    main()

def main():
    n, *x = list(map(int, open(0).read().split()))
    y = sorted(x)
    a, b = y[n // 2 - 1], y[n // 2]
    d = dict()
    for i, j in enumerate(y, 1):
        if i <= n // 2:
            d[j] = b
        else:
            d[j] = a
    for i in x:
        print((d[i]))


if __name__ == "__main__":
    main()

def main():
    n, *x = list(map(int, open(0).read().split()))
    y = sorted(x)
    a, b = y[n // 2 - 1], y[n // 2]
    ans = ""
    for i in x:
        if i <= a:
            ans += str(b) + "\n"
        else:
            ans += str(a) + "\n"
    print(ans)


if __name__ == "__main__":
    main()

-    d = dict() -    for i, j in enumerate(y, 1): -        if i <= n // 2: -            d[j] = b +    ans = "" +    for i in x: +        if i <= a: +            ans += str(b) + "\n" -            d[j] = a -    for i in x: -        print((d[i])) +            ans += str(a) + "\n" +    print(ans)