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 parseInt(a) - parseInt(b);
    });

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

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


