#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <functional>
#include <limits>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef vector<vector<int> > graph;
const double pi = acos(-1.0);
#define oned(a, x1, x2) { cout << #a << ":"; for(int _i = (x1); _i < (x2); _i++){ cout << " " << a[_i]; } cout << endl; }
#define twod(a, x1, x2, y1, y2) { cout << #a << ":" << endl; for(int _i = (x1); _i < (x2); _i++){ for(int _j = (y1); _j < (y2); _j++){ cout << (_j > y1 ? " " : "") << a[_i][_j]; } cout << endl; } }
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
const int MAXN = 200005;
int n, x[MAXN];
int mxl[MAXN], mxr[MAXN];
void solve() {
sort(x,x+n);
int ans;
if(n%2 == 0) {
ans = 2*1e9;
for(int i = 0; i < n/2; i++) {
ans = min(ans,x[i+n/2]-x[i]);
}
} else {
mxl[1] = x[1]-x[0];
for(int i = 3; i < n; i += 2) {
mxl[i] = max(mxl[i-2],x[i]-x[i-1]);
}
mxr[n-2] = x[n-1]-x[n-2];
for(int i = n-4; i >= 0; i -= 2) {
mxr[i] = max(mxr[i+2],x[i+1]-x[i]);
}
ans = min(mxl[n-2],mxr[1]);
for(int i = 2; i+2 < n; i += 2) {
ans = min(ans,max(mxl[i-1],mxr[i+1]));
}
}
printf("%d\n", ans);
}
int main() {
// freopen("input.in", "r", stdin);
while(scanf("%d", &n)==1) {
for(int i = 0; i < n; i++) {
scanf("%d", x+i);
}
solve();
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGlvbWFuaXA+CiNpbmNsdWRlIDxzc3RyZWFtPgojaW5jbH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