#include <bits/stdc++.h>
using namespace std;
int x[200000 + 5], n;
vector<int> res;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  sort(x + 1, x + 1 + n);
  int d = n / 2;
  for (int i = 1; i <= n - d; i++) res.push_back(x[i + d] - x[i]);
  sort(res.begin(), res.end());
  reverse(res.begin(), res.end());
  printf("%d", res[(n - 1) / 2]);
}
