"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.main = function (_N, dList) {
    var sortedDList = dList.slice().sort(function (a, b) { return a - b; });
    if (sortedDList.length % 2 !== 0)
        return 0;
    var half = sortedDList.length / 2;
    return sortedDList[half] - sortedDList[half - 1];
};
var exec = function () {
    var input = require('fs').readFileSync('/dev/stdin', 'UTF-8');
    var _a = input.split('\n'), N = _a[0], D = _a[1];
    var dList = D.split(' ').map(function (d) { return Number(d); });
    var res = exports.main(Number(N), dList);
    console.log(res);
};
exec();
