n = int(eval(input()))

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

def median(L):

    L = sorted(L)

    n = len(L)

    m = int(n/2)

    if n % 2 == 0:

        return (L[m - 1] + L[m]) / 2

    else:

        return L[(n - 1) // 2]

x_median = median(x)

l = median(sorted(x)[:-1])

r = median(sorted(x)[1:])

for i in range(n):

    if x[i] > x_median:

        print(l)

    else:

        print(r)
n = int(eval(input()))

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

x_sort = sorted(x)

def median(L):

    #L = sorted(L)

    n = len(L)

    m = int(n/2)

    if n % 2 == 0:

        return (L[m - 1] + L[m]) / 2

    else:

        return L[(n - 1) // 2]

x_median = median(x_sort)

l = median(x_sort[:-1])

r = median(x_sort[1:])

for i in range(n):

    if x[i] > x_median:

        print(l)

    else:

        print(r)
n = int(eval(input()))
x = list(map(int, input().split()))


def median(L):
    L = sorted(L)
    n = len(L)
    m = int(n / 2)
    if n % 2 == 0:
        return (L[m - 1] + L[m]) / 2
    else:
        return L[(n - 1) // 2]


x_median = median(x)
l = median(sorted(x)[:-1])
r = median(sorted(x)[1:])
for i in range(n):
    if x[i] > x_median:
        print(l)
    else:
        print(r)

n = int(eval(input()))
x = list(map(int, input().split()))
x_sort = sorted(x)


def median(L):
    # L = sorted(L)
    n = len(L)
    m = int(n / 2)
    if n % 2 == 0:
        return (L[m - 1] + L[m]) / 2
    else:
        return L[(n - 1) // 2]


x_median = median(x_sort)
l = median(x_sort[:-1])
r = median(x_sort[1:])
for i in range(n):
    if x[i] > x_median:
        print(l)
    else:
        print(r)

+x_sort = sorted(x) -    L = sorted(L) +    # L = sorted(L) -x_median = median(x) -l = median(sorted(x)[:-1]) -r = median(sorted(x)[1:]) +x_median = median(x_sort) +l = median(x_sort[:-1]) +r = median(x_sort[1:])