#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
void read(int& x){ scanf("%d",&x); }
template<typename T,typename... Args>
void read(T& a,Args&... b){ read(a); read(b...); }
#define all(x) (x).begin(),(x).end()
#define pb push_back

int lp[65536];
int rp[65536];
int V;

int n;
pp arr[20010];

void in(){
	read(n);
	for(int i=1; i<=n; ++i){
		int x, y; read(x, y);
		arr[2*i-1] = {x, 2*i};
		arr[2*i] = {y, 2*i+1};
	}
}

vector<int> e_base[65536];
vector<int> e_temp[65536];

void bt(int l, int r, int p){
	int mid = (l+r)/2;
	if(l == mid) e_base[p].pb(lp[p] = arr[l].second ^ 1);
	else lp[p] = ++V, e_base[p].pb(V), bt(l, mid, V);
	if(mid+1 == r) e_base[p].pb(rp[p] = arr[r].second ^ 1);
	else rp[p] = ++V, e_base[p].pb(V), bt(mid+1, r, V);
}

void build(){
	sort(arr+1, arr+2*n+1);
	V = 2*n+1;
	bt(1, 2*n, ++V);
}

int isang(int x){ return lower_bound(arr+1, arr+2*n+1, pp{x, -1}) - arr; }
int iha(int x){ return lower_bound(arr+1, arr+2*n+1, pp{x+1, -1}) - arr - 1; }

void draw(int l, int r, int from, int ml, int mr, int mp){
	if(l<=ml && mr<=r){
		e_temp[from].pb(mp);
		return;
	} else if(r<ml || mr<l) return;
	int mid=(ml+mr)/2;
	draw(l, r, from, ml, mid, lp[mp]);
	draw(l, r, from, mid+1, mr, rp[mp]);
}

int ind[65536];
int low[65536];
bool onstk[65536];
int stk[65536];
int cind[65536], cn;
int top;
int nt;

void dfs(int x){
	ind[x] = low[x] = ++nt;
	onstk[x]=1; stk[top++]=x;
	auto f=[&](int y){
		if(!ind[y]) dfs(y), low[x]=min(low[x], low[y]);
		else if(onstk[y]) low[x]=min(low[x], ind[y]);
	};
	for(int y:e_base[x]) f(y);
	for(int y:e_temp[x]) f(y);
	if(ind[x] == low[x]){
		++cn;
		while(top){
			int a=stk[--top];
			onstk[a]=0;
			cind[a]=cn;
			if(a == x) break;
		}
	}
}

bool can(int d){
	--d;
	for(int i=1; i<=V; ++i) e_temp[i].clear();
	for(int i=1; i<=2*n; ++i){
		int l=arr[i].first - d, r = arr[i].first + d;
		int me = arr[i].second;
		l = isang(l); r = iha(r);
		draw(l, i-1, me, 1, 2*n, 2*n+2);
		draw(i+1, r, me, 1, 2*n, 2*n+2);
	}
	nt=cn=top=0;
	for(int i=1; i<=V; ++i) ind[i]=0;
	for(int i=1; i<=V; ++i) if(!ind[i]) dfs(i);
	for(int i=1; i<=n; ++i){
		if(cind[2*i] == cind[2*i+1]) return 0;
	}
	return 1;
}

int main()
{
    in();
    build();
    ll l=0, r=2e9;
    while(l+1 < r){
		int mid=(l+r)/2;
		if(can(mid)) l=mid;
		else r=mid;
    }
    printf("%lld\n", l);
    return 0;
}
