N = int(eval(input()))

sorted_X = sorted([(v, i) for i, v in enumerate(map(int, input().split()))])

med_former = sorted_X[N // 2][0]

med_latter = sorted_X[N // 2 - 1][0]

ans = [-1] * N

for j, (v, i) in enumerate(sorted_X):

    if j < N // 2:

        ans[i] = med_former

    else:

        ans[i] = med_latter

print(("\n".join(map(str, ans))))

N, *X = list(map(int, open(0).read().split()))

sorted_X = sorted(X)

median_l = sorted_X[N // 2 - 1]

median_r = sorted_X[N // 2]



for x in X:

    if x < median_l:

        print(median_r)

    elif x == median_l:

        print(median_r)

    elif x == median_r:

        print(median_l)

    else:

        print(median_l)

N = int(eval(input()))
sorted_X = sorted([(v, i) for i, v in enumerate(map(int, input().split()))])
med_former = sorted_X[N // 2][0]
med_latter = sorted_X[N // 2 - 1][0]
ans = [-1] * N
for j, (v, i) in enumerate(sorted_X):
    if j < N // 2:
        ans[i] = med_former
    else:
        ans[i] = med_latter
print(("\n".join(map(str, ans))))

N, *X = list(map(int, open(0).read().split()))
sorted_X = sorted(X)
median_l = sorted_X[N // 2 - 1]
median_r = sorted_X[N // 2]
for x in X:
    if x < median_l:
        print(median_r)
    elif x == median_l:
        print(median_r)
    elif x == median_r:
        print(median_l)
    else:
        print(median_l)

-N = int(eval(input())) -sorted_X = sorted([(v, i) for i, v in enumerate(map(int, input().split()))]) -med_former = sorted_X[N // 2][0] -med_latter = sorted_X[N // 2 - 1][0] -ans = [-1] * N -for j, (v, i) in enumerate(sorted_X): -    if j < N // 2: -        ans[i] = med_former +N, *X = list(map(int, open(0).read().split())) +sorted_X = sorted(X) +median_l = sorted_X[N // 2 - 1] +median_r = sorted_X[N // 2] +for x in X: +    if x < median_l: +        print(median_r) +    elif x == median_l: +        print(median_r) +    elif x == median_r: +        print(median_l) -        ans[i] = med_latter -print(("\n".join(map(str, ans)))) +        print(median_l)