'use strict'

function main(s) {

  s = s.split('\n');

  const nums = s[1].split(' ').map(n => Number(n));

  const copy_nums = nums.slice(0);
  copy_nums.sort((a, b) => a - b);

  const med1 = copy_nums[copy_nums.length / 2];
  const med2 = copy_nums[(copy_nums.length / 2) - 1];

  const ans = [];

  for (const n of nums) {
    if (med1 > n)  ans.push(med1);
    if (med1 <= n) ans.push(med2);
  }

  console.log(ans.join('\n'));
}

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