def main():

    N = int(eval(input()))

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

    Xsort = sorted(X)

    for i in range(N):

        if X[i] <= Xsort[N//2-1]:

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

        else:

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



if __name__ == '__main__':

    main()

def main():



    N = int(eval(input()))

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

    Y = sorted(X)

    for i in range(N):

        if X[i] < Y[N//2]:

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

        else:

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



if __name__ == '__main__':

    # print(main())

    main()

def main():
    N = int(eval(input()))
    X = [int(x) for x in input().split()]
    Xsort = sorted(X)
    for i in range(N):
        if X[i] <= Xsort[N // 2 - 1]:
            print((Xsort[N // 2]))
        else:
            print((Xsort[N // 2 - 1]))


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    X = list(map(int, input().split()))
    Y = sorted(X)
    for i in range(N):
        if X[i] < Y[N // 2]:
            print((Y[N // 2]))
        else:
            print((Y[N // 2 - 1]))


if __name__ == "__main__":
    # print(main())
    main()

-    X = [int(x) for x in input().split()] -    Xsort = sorted(X) +    X = list(map(int, input().split())) +    Y = sorted(X) -        if X[i] <= Xsort[N // 2 - 1]: -            print((Xsort[N // 2])) +        if X[i] < Y[N // 2]: +            print((Y[N // 2])) -            print((Xsort[N // 2 - 1])) +            print((Y[N // 2 - 1])) +    # print(main())