'use strict'
let maxnum = 10e9 //Math.pow(10,9)
function countingSort(arr) {
  let sorted = []
  let tmp = [] //Array.apply(null, { length: maxnum + 1 }).map(v => 0)
  // console.log(tmparr.length)
  for (let i in arr) {
      if (tmp[arr[i]]) tmp[arr[i]] += 1
      else tmp[arr[i]] = 1
  }
  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.shift()
  const arr = input.slice(0, -1)
  //   let sorted =  [...arr].slice(0)
  //   mergeSort(sorted, 0, n) //arr.slice(0).sort((a, b) => a - b) //countingSort(arr)
  const sorted = countingSort([...arr])
  //   const sorted = [...arr].sort((a, b) => a - b) //countingSort(arr)
  const mid = sorted[n / 2]
  const mid2 = sorted[n / 2 - 1]
  //   console.log(arr, sorted, mid)

  const ans = []
  for (let i = 0; i < n; i++) {
    ans.push(arr[i] < mid ? mid : mid2)
  }
  console.log(ans.join('\n'))
}

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