
'use strict'
let maxnum = 109


function countingSort(arr) {
  const sorted = []
  let tmp = Array.apply(null, { length: maxnum + 1 }).map(v => 0) 
  for (let i in arr) {
    tmp[arr[i]]++
  }
  for (let i in tmp) {
    while (tmp[i] > 0) {
      sorted.push(~~i)
      tmp[i]--
    }
  } 

  return sorted
}

function main(input) {
  input = input.split(/\n|\s/).map(v => ~~v)
  const n = input[0]
  const arr = input.slice(1, n + 1) 
  const sorted = countingSort(arr)
  const mid = sorted[n / 2]
  const mid2 = sorted[n / 2 - 1] 

  for (let i = 0; i < n; i++) {
    if (arr[i] < mid) {
      console.log(mid)
    } else {
      console.log(mid2)
    }
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))