def solve(string):

    n, *x = list(map(int, string.split()))

    mid = n // 2

    x = [(i, _x) for i, _x in enumerate(x)]

    x = sorted(x, key=lambda x: x[1])

    ans = [[] for _ in range(n)]

    for i, _x in enumerate(x):

        ans[_x[0]] = str(x[mid][1]) if i < mid else str(x[mid - 1][1])

    return "\n".join(ans)





if __name__ == '__main__':

    print((solve('\n'.join([eval(input()), eval(input())]))))

def solve(string):

    n, *x = list(map(int, string.split()))

    mid = n // 2

    l, r = sorted(x)[mid - 1:mid + 1]

    return "\n".join([str(r) if _x < r else str(l) for _x in x])





if __name__ == '__main__':

    print((solve('\n'.join([eval(input()), eval(input())]))))

def solve(string):
    n, *x = list(map(int, string.split()))
    mid = n // 2
    x = [(i, _x) for i, _x in enumerate(x)]
    x = sorted(x, key=lambda x: x[1])
    ans = [[] for _ in range(n)]
    for i, _x in enumerate(x):
        ans[_x[0]] = str(x[mid][1]) if i < mid else str(x[mid - 1][1])
    return "\n".join(ans)


if __name__ == "__main__":
    print((solve("\n".join([eval(input()), eval(input())]))))

def solve(string):
    n, *x = list(map(int, string.split()))
    mid = n // 2
    l, r = sorted(x)[mid - 1 : mid + 1]
    return "\n".join([str(r) if _x < r else str(l) for _x in x])


if __name__ == "__main__":
    print((solve("\n".join([eval(input()), eval(input())]))))

-    x = [(i, _x) for i, _x in enumerate(x)] -    x = sorted(x, key=lambda x: x[1]) -    ans = [[] for _ in range(n)] -    for i, _x in enumerate(x): -        ans[_x[0]] = str(x[mid][1]) if i < mid else str(x[mid - 1][1]) -    return "\n".join(ans) +    l, r = sorted(x)[mid - 1 : mid + 1] +    return "\n".join([str(r) if _x < r else str(l) for _x in x])