/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
6
9 1 4 4 6 7
---+/
/+---test
8
9 1 14 5 5 4 4 14
---+/
/+---test
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1
---+/

void main(string[] args) {
  readln;
  const D = readln.split.map!(to!long).array.sort!"a > b".array;
  const N = D.length;

  auto x = N/2;
  if (x*2 != N) {
    0.writeln;
    return;
  }
  (D[x-1] - D[x]).writeln;
}
