"use strict";
    
const lowerBound = (arr, n) => {
    let first = 0, last = arr.length - 1, middle;
    while (first <= last) {
        middle = 0 | (first + last) / 2;
        if (arr[middle] < n) first = middle + 1;
        else last = middle - 1;
    }
    return first;
}

const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const X = arg[1].split(" ").map(n=>parseInt(n));
    const Xa = [...X].sort((a,b)=>a-b);
    
    const median = Xa[Xa.length / 2]
    const left = Xa[(Xa.length / 2) - 1];
    const right = Xa[(Xa.length / 2) + 1];
    
    // console.log(median);
    
    let answer = [];
    
    for(let i in X) {
        if(X[i] < median) {
            answer.push(median);
        } else {
            answer.push(left);
        }
    }
    
    console.log(answer.join("\n"));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));