#include<cstdio>
#include<algorithm>
const int MaxN=10010;
int N;
struct item{
	int i,x;
	bool operator<(const item&it)const{return x<it.x;}
}a[MaxN*2];
int V[MaxN][2],ch[MaxN*4][2],rt,tot;
int left[MaxN*2],opp[MaxN*2],right[MaxN*2];
int build(int l,int r){
	if(r-l==1)return l;
	int o=tot++,mid=l+r>>1;
	ch[o][0]=build(l,mid);
	ch[o][1]=build(mid,r);
	return o;
}
int dfn[MaxN*4],low[MaxN*4],now,stk[MaxN*4],top,scc[MaxN*4],scnt;
void cmin(int&a,int b){b<a?a=b:1;}
void dfs(int i,int M);
void find(int o,int L,int R,int l,int r,int fr,int M){
	if(l>=r)return;
	if(l==L&&r==R){
		if(!dfn[o])dfs(o,M),cmin(low[fr],low[o]);
		else if(!scc[o])cmin(low[fr],dfn[o]);
	}
	else{
		int Mid=L+R>>1;
		if(r<=Mid)find(ch[o][0],L,Mid,l,r,fr,M);
		else if(l>=Mid)find(ch[o][1],Mid,R,l,r,fr,M);
		else{
			find(ch[o][0],L,Mid,l,Mid,fr,M);
			find(ch[o][1],Mid,R,Mid,r,fr,M);
		}
	}
}
void dfs(int i,int M){
	dfn[i]=low[i]=++now;
	stk[top++]=i;
	if(i<N*2){
		find(rt,0,N*2,left[i],opp[i],i,M);
		find(rt,0,N*2,opp[i]+1,right[i],i,M);
	}
	else for(int c=0;c<2;c++){
		int t=ch[i][c];
		if(!dfn[t])dfs(t,M),cmin(low[i],low[t]);
		else if(!scc[t])cmin(low[i],dfn[t]);
	}
	if(low[i]==dfn[i]){
		scnt++;
		do scc[stk[--top]]=scnt;
		while(stk[top]!=i);
	}
}
bool chk(int M){
	now=top=scnt=0;
	for(int i=0;i<tot;i++)dfn[i]=scc[i]=0;
	for(int i=0;i<N;i++){
		for(int j=0;j<2;j++){
			left[V[i][!j]]=std::lower_bound(a,a+N*2,(item){0,a[V[i][j]].x-M+1})-a;
			right[V[i][!j]]=std::upper_bound(a,a+N*2,(item){0,a[V[i][j]].x+M-1})-a;
			opp[V[i][!j]]=V[i][j];
		}
	}
	for(int i=0;i<N*2;i++)if(!dfn[i])dfs(i,M);
	for(int i=0;i<N;i++)
		if(scc[V[i][0]]==scc[V[i][1]])return 0;
	return 1;
}
int main(){
	scanf("%d",&N);
	for(int i=0,x,y;i<N;i++){
		scanf("%d%d",&x,&y);
		a[i*2]=(item){i,x};
		a[i*2+1]=(item){i,y};
		V[i][0]=V[i][1]=-1;
	}
	std::sort(a,a+N*2);
	for(int i=0;i<N*2;i++)V[a[i].i][V[a[i].i][0]!=-1]=i;
	tot=N*2;
	rt=build(0,N*2);
	int l=0,r=1000000001,mid;
	while(r-l>1)chk(mid=l+r>>1)?l=mid:r=mid;
	printf("%d\n",l);
}