output_description: Print N lines. The i-th line should contain B_i.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      X_1 X_2 ... X_N
attempt: # import itertools
  # import math
  # from functools import reduce
  # import sys
  # sys.setrecursionlimit(500*500)
  # import numpy as np
  # import heapq
  # from collections import deque
  import copy
  
  N = int(input())
  # S = input()
  # n, *a = map(int, open(0))
  # N, M = map(int, input().split())
  X = list(map(int, input().split()))
  # B = list(map(int, input().split()))
  # tree = [[] for _ in range(N + 1)]
  # B_C = [list(map(int,input().split())) for _ in range(M)]
  # S = input()
  
  # B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
  # all_cases = list(itertools.permutations(P))
  # a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
  # itertools.product((0,1), repeat=n)
  
  # A = np.array(A)
  # cum_A = np.cumsum(A)
  # cum_A = np.insert(cum_A, 0, 0)
  
  # def dfs(tree, s):
  #     for l in tree[s]:
  #         if depth[l[0]] == -1:
  #             depth[l[0]] = depth[s] + l[1]
  #             dfs(tree, l[0])
  # dfs(tree, 1)
  
  # def factorization(n):
  #     arr = []
  #     temp = n
  #     for i in range(2, int(-(-n**0.5//1))+1):
  #         if temp%i==0:
  #             cnt=0
  #             while temp%i==0:
  #                 cnt+=1
  #                 temp //= i
  #             arr.append([i, cnt])
  #     if temp!=1:
  #         arr.append([temp, 1])
  #     if arr==[]:
  #         arr.append([n, 1])
  #     return arr
  
  # def make_divisors(n):
  #    lower_divisors , upper_divisors = [], []
  #    i = 1
  #    while i*i <= n:
  #        if n % i == 0:
  #            lower_divisors.append(i)
  #            if i != n // i:
  #                upper_divisors.append(n//i)
  #        i += 1
  #    return lower_divisors + upper_divisors[::-1]
  
  # def gcd_list(numbers):
  #     return reduce(math.gcd, numbers)
  
  # if gcd_list(A) > 1:
  #     print("not coprime")
  #     exit()
  
  # 高速素因数分解準備
  # MAXN = 10**6+10
  # sieve = [i for i in range(MAXN+1)]
  # p = 2
  # while p*p <= MAXN:
  #    if sieve[p] == p:
  #        for q in range(2*p, MAXN+1, p):
  #            if sieve[q] == q:
  #                sieve[q] = p
  #    p += 1
  
  X = [[i, x] for i, x in enumerate(X)]
  X = sorted(X, reverse=False, key=lambda x: x[1])
  X_ranked = copy.copy(X)
  X = [[l[0], i, l[1]] for i, l in enumerate(X)]
  X = sorted(X, reverse=False, key=lambda x: x[0])
  
  med = len(X) // 2
  
  for l in X:
      if l[1] < med:
          print(X_ranked[med][1])
      else:
          print(X_ranked[med - 1][1])
  
problem_description: Statement
  
  When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the
  (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.
  
  You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For
  each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i,
  that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.
  
  Find B_i for each i = 1, 2, ..., N.
samples: [{"input": "4\n    2 4 4 3", "output": "4\n    3\n    3\n    4\n    \n\n  * Since the median of X_2, X_3, X_4 is 4, B_1 = 4.\n  * Since the median of X_1, X_3, X_4 is 3, B_2 = 3.\n  * Since the median of X_1, X_2, X_4 is 3, B_3 = 3.\n  * Since the median of X_1, X_2, X_3 is 4, B_4 = 4.\n\n* * *"}, {"input": "2\n    1 2", "output": "2\n    1\n    \n\n* * *"}, {"input": "6\n    5 5 4 4 3 3", "output": "4\n    4\n    4\n    4\n    4\n    4"}]