N=int(eval(input()))

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



X_sort=sorted(X)



if X_sort[N//2-1]==X_sort[N//2]:

    for n in range(N):

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

else:

    if X_sort.count(X_sort[N//2-1])==1:

        for n in range(N):

            if X[n]>X_sort[N//2-1]:

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

            else:

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

    else:

        for n in range(N):

            if X[n]>X_sort[N//2-1]:

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

            else:

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

N = int(eval(input()))

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

Xs = sorted(X)

Bl = Xs[(N-1)//2]

Br = Xs[N//2]

for i in range(N):

    if Bl < X[i]:

        print(Bl)

    else:

        print(Br)

N = int(eval(input()))
X = list(map(int, input().split()))
X_sort = sorted(X)
if X_sort[N // 2 - 1] == X_sort[N // 2]:
    for n in range(N):
        print((X_sort[N // 2]))
else:
    if X_sort.count(X_sort[N // 2 - 1]) == 1:
        for n in range(N):
            if X[n] > X_sort[N // 2 - 1]:
                print((X_sort[N // 2 - 1]))
            else:
                print((X_sort[N // 2]))
    else:
        for n in range(N):
            if X[n] > X_sort[N // 2 - 1]:
                print((X_sort[N // 2 - 1]))
            else:
                print((X_sort[N // 2]))

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

-X_sort = sorted(X) -if X_sort[N // 2 - 1] == X_sort[N // 2]: -    for n in range(N): -        print((X_sort[N // 2])) -else: -    if X_sort.count(X_sort[N // 2 - 1]) == 1: -        for n in range(N): -            if X[n] > X_sort[N // 2 - 1]: -                print((X_sort[N // 2 - 1])) -            else: -                print((X_sort[N // 2])) +Xs = sorted(X) +Bl = Xs[(N - 1) // 2] +Br = Xs[N // 2] +for i in range(N): +    if Bl < X[i]: +        print(Bl) -        for n in range(N): -            if X[n] > X_sort[N // 2 - 1]: -                print((X_sort[N // 2 - 1])) -            else: -                print((X_sort[N // 2])) +        print(Br)