function main( input = `126 -999 266 169 -939 497 645 659 -210 300 834 400 1000 -68 -187 156 -579 79 -985 246 704 98 74 53 746 -219 80 482 -645 12 707 -702 212 719 915 175 61 -599 683 -85 -672 948 -335 -685 -897 327 659 192 -85 723 -363 -190 -734 648 975 566 -237 450 -664 -89 891 789 -13 538 328 974 380 48 968 397 554 -659 872 -100 28 986 717 964 99 -646 100 -590 453 930 337 -758 -137 -945 -66 -541 773 222 919 822 790 -916 -250 -510 604 392 756 428 990 535 -935 166 -170 -889 -304 164 555 337 -201 -942 -36 973 742 294 842 473 -151 -961 452 -8 -656 -653 -286 ` ) { if (!input) throw Error; let lines = input.split('\n'); let length = parseInt(lines[0]); let nums = lines[1] .split(' ') .map((val) => parseInt(val)) .sort((a, b) => a - b); if (length % 2 === 0) { return `${(nums[length / 2] + nums[length / 2 - 1]) / 2}`; } else { return `${nums[Math.floor(length / 2)]}`; } } const { readFileSync, existsSync } = require('fs'); const stdin = '/dev/stdin'; if (existsSync(stdin)) { const input = readFileSync(stdin, 'utf8'); console.log(main(input)); } module.exports = main;