

'use strict'

function main(input) {

    input = input.split('\n')
    const n = ~~input[0]
    const x = input[1].split(' ').map(v => ~~v)
    const x2 = x.slice(0).sort((a, b) => a - b)

    const mid = x2[n / 2]
    const mid2 = x2[n / 2 - 1]

    let ans = ''
    for (let i = 0; i < n; i++) {
        if (x[i] < mid) ans += mid+'\n'
        else ans += mid2+'\n'

    }

    console.log(ans)
}

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