def medians(nums):

    n = len(nums)

    num_orig_pos = list(zip(nums, list(range(n))))

    nums_sorted = sorted(num_orig_pos)

    medians = []

    med_left = nums_sorted[(n + 1)//2][0]

    med_right = nums_sorted[(n + 1)//2 - 1][0]

    for i in range((n + 1)//2):

        medians.append((med_left, nums_sorted[i][1]))

    for i in range((n + 1)//2, n):

        medians.append((med_right, nums_sorted[i][1]))

    return [x[0] for x in sorted(medians, key=lambda x: x[1])]





if __name__ == '__main__':

    _ = eval(input())

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

    for i in medians(nums):

        print(i)
def medians(nums, n):

    median_left = nums[(n + 1)//2]

    median_right = nums[(n + 1)//2 - 1]

    return median_left, median_right





if __name__ == '__main__':

    n = int(input())

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

    median_left, median_right = medians(sorted(nums), n)

    for i in nums:

        print(median_left) if i < median_left else print(median_right)

def medians(nums):
    n = len(nums)
    num_orig_pos = list(zip(nums, list(range(n))))
    nums_sorted = sorted(num_orig_pos)
    medians = []
    med_left = nums_sorted[(n + 1) // 2][0]
    med_right = nums_sorted[(n + 1) // 2 - 1][0]
    for i in range((n + 1) // 2):
        medians.append((med_left, nums_sorted[i][1]))
    for i in range((n + 1) // 2, n):
        medians.append((med_right, nums_sorted[i][1]))
    return [x[0] for x in sorted(medians, key=lambda x: x[1])]


if __name__ == "__main__":
    _ = eval(input())
    nums = list(map(int, input().split()))
    for i in medians(nums):
        print(i)

def medians(nums, n):
    median_left = nums[(n + 1) // 2]
    median_right = nums[(n + 1) // 2 - 1]
    return median_left, median_right


if __name__ == "__main__":
    n = int(input())
    nums = list(map(int, input().split()))
    median_left, median_right = medians(sorted(nums), n)
    for i in nums:
        print(median_left) if i < median_left else print(median_right)

-def medians(nums): -    n = len(nums) -    num_orig_pos = list(zip(nums, list(range(n)))) -    nums_sorted = sorted(num_orig_pos) -    medians = [] -    med_left = nums_sorted[(n + 1) // 2][0] -    med_right = nums_sorted[(n + 1) // 2 - 1][0] -    for i in range((n + 1) // 2): -        medians.append((med_left, nums_sorted[i][1])) -    for i in range((n + 1) // 2, n): -        medians.append((med_right, nums_sorted[i][1])) -    return [x[0] for x in sorted(medians, key=lambda x: x[1])] +def medians(nums, n): +    median_left = nums[(n + 1) // 2] +    median_right = nums[(n + 1) // 2 - 1] +    return median_left, median_right -    _ = eval(input()) +    n = int(input()) -    for i in medians(nums): -        print(i) +    median_left, median_right = medians(sorted(nums), n) +    for i in nums: +        print(median_left) if i < median_left else print(median_right)