function main(input){
  var line1 = parse(input[0]);
  var n = line1[0];
  var x = parse(input[1]);
  var sorted = JSON.parse(JSON.stringify(x)).sort();
  var first = sorted[n/2 - 1];
  var last = sorted[n/2];
  for (var i = 0; i < n; i++) {
    if (x[i] <= first) {
      console.log(last);
    } else {
      console.log(first);
    }
  }
}

function parse(line){
  var ret = [];
  var arr = line.split(' ');
  for (var i = 0; i < arr.length; i++) {
    ret.push(parseInt(arr[i]));
  }
  return ret;
}

var
input = '';

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
process.stdin.on('end', function() {
  input = input.split('\n');
  main(input);
});
