#include<bits/stdc++.h>
using namespace std;
namespace ProjectSedge
{
	struct edge
	{
		int to,w;
		edge(int x2=0,int x3=0){to=x2,w=x3;}
	};
	vector<edge>e[1000001];
	int seg[1000001*4];
	int mx,add;
	void build(int node,int l,int r)
	{
		if(l==r)
		{
			seg[l]=node;
			e[node].push_back(node+add);
			return;
		}
		int mid=(l+r)/2;
		e[node].push_back(edge(node*2,0));
		e[node].push_back(edge(node*2+1,0));
		e[node*2+add].push_back(edge(node+add,0));
		e[node*2+1+add].push_back(edge(node+add,0));
		build(node*2,l,mid);
		build(node*2+1,mid+1,r);
	}
	void init(int x)
	{
		for(int i=1;i<=add*2;i++)
			e[i].clear();
		mx=x;
		add=mx*4;
		build(1,1,mx);
	}
	void connect(int node,int st,int ed,int l,int r,int x,int ind)
	{
		if(st>r||ed<l) return;
		if(st>=l&&ed<=r)
		{
			e[seg[x]+add].push_back(edge(node,ind));
			return;
		}
		int mid=(st+ed)/2;
		connect(node*2,st,mid,l,r,x,ind);
		connect(node*2+1,mid+1,ed,l,r,x,ind);
	}
}
using namespace ProjectSedge;
int tot,cnt;
int dfn[1000001],low[1000001],vis[1000001],col[1000001];
stack<int>s;
void tarjan(int u)
{
	low[u]=dfn[u]=++cnt;
	s.push(u);
	vis[u]=1;
	for(int i=0;i<e[u].size();i++)
	{
		int to=e[u][i].to;
		if(!dfn[to])
		{
			tarjan(to);
			low[u]=min(low[u],low[to]);
		}
		else if(vis[to])
			low[u]=min(low[u],dfn[to]);
	}
	if(dfn[u]==low[u])
	{
		tot++;
		while(s.top()!=u)
		{
			col[s.top()]=tot;
			vis[s.top()]=0;
			s.pop();
		}
		col[u]=tot;
		vis[u]=0;
		s.pop();
	}
}
int n;
struct node
{
	int v,id;
}p[1000001];
bool cmp(node a,node b){return a.v<b.v;}
pair<int,int> get(int x,int d)
{
	int l=0,r=2*n+1,ansl,ansr;
	while(l+1<r)
	{
		int mid=(l+r)/2;
		if(p[mid].v<x-d+1) l=mid;
		else r=mid;
	}
	ansl=r;
	l=0,r=2*n+1;
	while(l+1<r)
	{
		int mid=(l+r)/2;
		if(p[mid].v<=x+d-1) l=mid;
		else r=mid;
	}
	ansr=l;
	return make_pair(ansl,ansr);
}
int rev[1000001];
int oth[1000001];
bool check(int d)
{
	init(n*2);
	tot=0,cnt=0;
	memset(dfn,0,sizeof(dfn));
	memset(low,0,sizeof(low));
	memset(col,0,sizeof(col));
	memset(vis,0,sizeof(vis));
	for(int i=1;i<=2*n;i++)
	{
		pair<int,int> pr=get(p[i].v,d);
		connect(1,1,mx,pr.first,i-1,rev[oth[p[i].id]],0);
		connect(1,1,mx,i+1,pr.second,rev[oth[p[i].id]],0);			
	}
	for(int i=1;i<=add*2;i++)
		if(!col[i])
			tarjan(i);
	for(int i=1;i<=n;i++)
		if(col[seg[rev[i]]]==col[seg[rev[i+n]]])
			return false;
	return true;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&p[i].v,&p[i+n].v);
		p[i].id=i,p[i+n].id=i+n,oth[i]=i+n,oth[i+n]=i;
	}
	sort(p+1,p+2*n+1,cmp);
	for(int i=1;i<=2*n;i++)
		rev[p[i].id]=i;
	int l=-1,r=1000000001;
	while(l+1<r)
	{
		int mid=(l+r)/2;
		if(check(mid))
			l=mid;
		else
			r=mid;
	}
	printf("%d",l);
	return 0;
}
/*
2
1 2
1 4
*/
