let input = require('fs').readFileSync('/dev/stdin', 'utf8'); let A = input.split('\n')[1].split(/\s/).map(v => Number(v)); A = A.sort((a, b) => a - b); if (A.length % 2) { console.log(A[~~(A.length / 2)]); } else { console.log((A[A.length / 2 - 1] + A[A.length / 2]) / 2); }