#include <bits/stdc++.h>
using namespace std;
int n,K,T,S,cnt,t,x,y,L,R,M,rt;
int ps[10005][2],sz[60005];
int lc[60005],rc[60005],op[60005];
int dfn[60005],low[60005],inq[60005],Q[60005],be[60005];
vector <int> e[60005];
struct O{
	int x,i;
}a[20005];
bool cmx(O a,O b){
	return a.x<b.x;
}
void add(int u,int v){
	e[u].push_back(v);
	e[op[v]].push_back(op[u]);
}
void build(int &u,int p,int q){
	if (p==q) {u=p; return;}
	u=++cnt; ++cnt;
	op[u]=u+1; op[u+1]=u;
	build(lc[u],p,(p+q)/2);
	build(rc[u],(p+q)/2+1,q);
	add(lc[u],u);
	add(rc[u],u);
}
void ADD(int x,int u,int p,int q,int l,int r){
	if (l<=p&&q<=r){
		add(x,op[u]);
		return;
	}
	if (l<=(p+q)/2) ADD(x,lc[u],p,(p+q)/2,l,r);
	if (r>(p+q)/2) ADD(x,rc[u],(p+q)/2+1,q,l,r);
}
void dfs(int x){
	dfn[x]=low[x]=++T;
	inq[x]=1; Q[++K]=x;
	for (unsigned i=0;i<e[x].size();++i)
	if (!dfn[e[x][i]]){
		dfs(e[x][i]);
		low[x]=min(low[x],low[e[x][i]]);
	}else
	if (inq[e[x][i]])
		low[x]=min(low[x],dfn[e[x][i]]);
	if (dfn[x]==low[x]){
		++S; Q[K+1]=0;
		while (Q[K+1]!=x){
			inq[Q[K]]=0;
			be[Q[K]]=S;
			--K;
		}
	}
}
bool check(){
	for (int i=1;i<=cnt;++i) e[i].resize(sz[i]);
	for (int i=1,j=1;i<=t;++i){
		while (a[j].x<=a[i].x-M) ++j;
		if (j<i) ADD(i,rt,1,t,j,i-1);
	}
	for (int i=t,j=t;i;--i){
		while (a[j].x>=a[i].x+M) --j;
		if (j>i) ADD(i,rt,1,t,i+1,j);
	}
	T=S=K=0;
	for (int i=1;i<=cnt;++i) dfn[i]=0;
	for (int i=1;i<=cnt;++i)
	if (!dfn[i]) dfs(i);
	for (int i=1;i<=cnt;++i)
	if (be[i]==be[op[i]]) return 0;
	return 1;
}
int main(){
//	freopen("windmills.in","r",stdin);
//	freopen("windmills.out","w",stdout);
	scanf("%d",&n);
	for (int i=1;i<=n;++i){
		scanf("%d%d",&x,&y);
		a[++t]=(O){x,i};
		a[++t]=(O){y,-i};
	}
	sort(a+1,a+t+1,cmx);
	for (int i=1;i<=t;++i)
		if (a[i].i>0) ps[a[i].i][0]=i;
		else ps[-a[i].i][1]=i;
	for (int i=1;i<=n;++i){
		op[ps[i][0]]=ps[i][1];
		op[ps[i][1]]=ps[i][0];
	}
	cnt=t; build(rt,1,t);
	for (int i=1;i<=cnt;++i) sz[i]=e[i].size();
	L=0; R=1000000000;
	while (L<R){
		M=(L+R+1)/2;
		if (check()) L=M; else R=M-1;
	}
	printf("%d\n",L);
	return 0;
}
