'use strict'

function main(input) {
  input = input.split('\n')
  let n = ~~input[0]
  let x = input[1].split(' ').map(v => ~~v).sort((a, b) => a - b)
  let mid = x[n / 2]
  for (let i = 0; i < n; i++) {

      // 
      if (x[i] < mid) {
          console.log(x[(n) / 2])

      } else {
          console.log(x[(n) / 2-1])
      }

  }
}

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