'use strict' 

function main(input) {
  input = input.split(/\n|\s/).map(v => ~~v)
  const n = input.shift()
  const arr = input
  const sorted = [...arr].sort((a, b) => a-b)
  const mid = sorted[n / 2]
  const mid2 = sorted[n / 2 - 1] 
  let 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'))
