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 math
  import fractions
  import copy
  
  
  # 以下てんぷら
  def j(q):
      if q == 1:
          print("Yes")
      elif q == 0:
          print("No")
      exit(0)
  
  
  rem = pow(10, 9) + 7
  """
  def ct(x,y):
      if (x>y):print("+")
      elif (x<y): print("-")
      else: print("?")
  """
  
  
  def ip():
      return int(input())
  
  
  def printrow(a):
      for i in a:
          print(i)
  
  
  def combinations(n, r):
      if n < r:
          return 0
      return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
  
  def permutations(n, r):
      if n < r:
          return 0
      return math.factorial(n) // math.factorial(n - r)
  
  
  def lcm(x, y):
      return (x * y) // fractions.gcd(x, y)
  
  
  n = ip()  # 入力整数1つ
  # r,x,y= (int(i) for i in input().split())       #入力整数横2つ以上
  a = [int(i) for i in input().split()]  # 入力整数配列
  # a = input()                                  #入力文字列
  # a = input().split()                          #入力文字配列
  # n = ip()                      #入力セット(整数改行あり)(1/2)
  # a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
  # a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
  # jの変数はしようできないので注意
  # 全足しにsum変数使用はsum関数使用できないので注意
  # a.pop(0)は10^5あるときTLEしやすい!注意!
  # これを消すとなぜかWAになる呪い
  b = sorted(a)
  leftmed = b[n // 2 - 1]
  rightmed = b[n // 2]
  for i in range(n):
      if a[i] >= rightmed:
          print(leftmed)
      else:
          print(rightmed)
  
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"}]