#include<bits/stdc++.h>
#define maxn 400010
using namespace std;
const int inf=1e9+7;
int n;
struct node{
	int pos,id;;
}a[maxn];
int ans;
int zy;
bool cmp(node a,node b){
//	if(a.pos!=b.pos)
	return a.pos<b.pos;
//	else return a.id<b.id;
}
struct hh{
	int v,nxt;
}e[10010*10010];
int head[maxn],tot;
void add(int a,int b){
    e[++tot].nxt=head[a];head[a]=tot;e[tot].v=b;
}
int low[maxn],in[maxn],dfn[maxn],bel[maxn];
int top,st[maxn];
int num,tim;
int mp[maxn];
void tarjan(int x){
    low[x]=dfn[x]=++tim;
    st[++top]=x;
    in[x]=1;
    for(int i=head[x];i;i=e[i].nxt){
		int v=e[i].v;
        if(!dfn[v]){
            tarjan(v);
            low[x]=min(low[x],low[v]);
        }
        else if(in[v]){
			low[x]=min(low[x],dfn[v]);
		}
    }
    if(low[x]==dfn[x]){
        int y;num++;
        do{
            y=st[top--];
            in[y]=0;
            bel[y]=num;
        }while(y!=x);
    }
}
int mx;
void build(int u,int l,int r){
	mx=max(mx,u);
	if(l==r){
		add(u+zy,mp[a[l].id]);
	//	cout<<u+zy<<" "<<fan[a[l].id]<<endl;
		return ;
	}
	int mid=(l+r)>>1;
	//printf("&%d %d %d\n",u,l,r);
	int tp=u;
	add(u+zy,(u<<1)+zy);
	add(u+zy,(u<<1|1)+zy);
	build(u<<1,l,mid);
	build(u<<1|1,mid+1,r);
}
void insert(int u,int l,int r,int ql,int qr,int id){
	if(ql<=l && qr>=r){
		add(id,u+zy);
		return ;
	}
	int mid=(l+r)>>1;
	if(ql<=mid)insert(u<<1,l,mid,ql,qr,id);
	if(qr>mid)insert(u<<1|1,mid+1,r,ql,qr,id);
}
void addedge(int x){
	int l=1,r=1;
	build(1,1,zy);//printf("*\n");
	for(int i=1;i<=zy;i++){
		while(l<i && (a[i].pos-a[l].pos)>=x){
			l++;
		}
		while(r<=zy && (a[r+1].pos-a[i].pos)<x){
			r++;
		}
		if(l!=i)insert(1,1,zy,l,i-1,a[i].id);
		if(r!=i)insert(1,1,zy,i+1,r,a[i].id);
	}//cerr<<top<<endl;
}
bool check(int x){
	memset(dfn,0,sizeof dfn);
	memset(head,0,sizeof head);
	tot=0;tim=num=0;//top=0;
	addedge(x);//cerr<<top<<endl;
	for(int i=1;i<=zy+mx;i++){
		if(!dfn[i]){
	//	cerr<<"*"<<endl;
			tarjan(i);
		}
	}//cerr<<"*"<<endl;
	for(int i=1;i<=zy;i++){
		if(bel[i]==bel[mp[i]])return 0;
	}
	return 1;
}
void file(){
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}
struct node2{int x,y;}b[110];
int res[110];
bool cmp1(node2 a,node2 b){
	if(a.x!=b.x)return a.x<b.x;
	else return a.y<b.y;
}
void dfs(int cnt,int ress){
	if(cnt>n){
		ans=max(ans,ress);
		return ;
	}
	int tp=ress;
	for(int i=1;i<cnt;i++){
		ress=min(ress,abs(b[cnt].x-res[i]));
	}
	res[cnt]=b[cnt].x;
	dfs(cnt+1,ress);
	ress=tp;
	for(int i=1;i<cnt;i++){
		ress=min(ress,abs(b[cnt].y-res[i]));
	}
	res[cnt]=b[cnt].y;
	dfs(cnt+1,ress);
	ress=tp;
}
void solve1(){
	for(int i=1;i<=n;i++){
		scanf("%d%d",&b[i].x,&b[i].y);
		if(b[i].x>b[i].y)swap(b[i].x,b[i].y);
	}
	sort(b+1,b+n+1,cmp1);
	ans=-inf;
	dfs(1,inf);
	printf("%d\n",ans);//cerr<<clock()/1000<<endl;
}
int main(){
	//file();
	//cerr<<(sizeof(e)+sizeof(a)+sizeof(low)*7+sizeof(b))/1024/1024<<endl;
	scanf("%d",&n);
	if(n<=18){
		solve1();return 0;
	}
	zy=0;
	for(int i=1;i<=n;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		if(x>y)swap(x,y);
		a[++zy].pos=x;a[zy].id=zy;
		a[++zy].pos=y;a[zy].id=zy;
		mp[zy-1]=zy;mp[zy]=zy-1;
	}
	sort(a+1,a+zy+1,cmp);
	int l=0,r=1000000000;
	while(l<=r){
		int mid=(l+r)>>1;
		if(check(mid)){
			l=mid+1;	
		}
		else r=mid-1;
	}
	printf("%d\n",r);
	return 0;
}

Measured memory_bytes: 20992