function main(input) {
    var lines = input.split('\n');
    var line1 = lines[0];
    var line2 = lines[1].split(' ');

    var N = parseInt(line1);

    var XList = line2.map(function(str){return parseInt(str)});

    var orderedList = line2.sort(function(a, b){
        return a - b;
    });

    var lowerMedian = orderedList[N / 2 - 1];
    var higherMedian = orderedList[N / 2];

    XList.forEach(function(Xn){
        console.log(Xn <= lowerMedian ? higherMedian : lowerMedian);
    });
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


