#include<bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define  For(i,a,b) for(int i=a,i##E=b;i<=i##E;++i)
#define rFor(i,a,b) for(int i=a,i##E=b;i>=i##E;--i)
typedef long long LL;
using namespace std;
const int N=20010;
const int M=40000010;
const int inf=0x3f3f3f3f;
template<typename T>inline bool chkmin(T &a,const T &b){return a>b?a=b,1:0;}
template<typename T>inline bool chkmax(T &a,const T &b){return a<b?a=b,1:0;}
template<typename T>inline void read(T &x)
{
	x=0;int _f(0);char ch=getchar();
	while(!isdigit(ch))_f|=(ch=='-'),ch=getchar();
	while( isdigit(ch))x=x*10+ch-'0',ch=getchar();
	x=_f?-x:x;
}
inline void file()
{
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}
int n,cnt;
int x[N],y[N];
int bgn[N],nxt[M],to[M],E;
int dfn[N],low[N],dfs_time;
int bel[N],st[N],top,in[N];
int scc_cnt;
struct node
{
	int pos,id,type;
	node(){}
	node(int pos,int id,int type):pos(pos),id(id),type(type){}
}a[N];
inline bool operator<(node A,node B){return A.pos<B.pos;}
inline void add_edge(int u,int v)
{
	//printf("%d %d\n",u,v);
	nxt[++E]=bgn[u],bgn[u]=E,to[E]=v;
}
inline void dfs(int u)
{
	dfn[u]=low[u]=++dfs_time;
	in[st[++top]=u]=1;
	for(int v,i=bgn[u];i;i=nxt[i])
	{
		if(!dfn[v=to[i]])
		{
			dfs(v);
			chkmin(dfn[u],low[v]);
		}
		else if(in[v])chkmin(dfn[u],dfn[v]);
	}
	if(low[u]==dfn[u])
	{
		++scc_cnt;
		int x;
		do
		{
			x=st[top--];
			in[x]=0;
			bel[x]=scc_cnt;
		}while(x!=u);
	}
}
inline bool check(int x)
{
	mem(dfn,0);
	mem(bgn,0);
	mem(bel,0);
	E=0;
	scc_cnt=0;
	dfs_time=0;
	int nowl=1,nowr=1;
	For(i,1,cnt)
	{
		while(nowl<cnt&&a[nowl].pos<=a[i].pos-x)nowl++;
		while(nowr<cnt&&a[nowr+1].pos<a[i].pos+x)nowr++;
		For(j,max(i-50,nowl),i)
		if(i!=j)
		{
			add_edge(a[i].id*2+a[i].type,a[j].id*2+(a[j].type^1));
			add_edge(a[j].id*2+a[j].type,a[i].id*2+(a[i].type^1));
		}
		For(j,i,min(i+50,nowr))
		if(i!=j)
		{
			add_edge(a[i].id*2+a[i].type,a[j].id*2+(a[j].type^1));
			add_edge(a[j].id*2+a[j].type,a[i].id*2+(a[i].type^1));
		}
	}
	For(i,1,n)
	{
		if(!dfn[i*2])dfs(i*2);
		if(!dfn[i*2+1])dfs(i*2+1);
	}
	For(i,1,n)if(bel[i*2]==bel[i*2+1])return 0;
	return 1;
}
int main()
{
	//file();
	read(n);
	int MAX=0;
	For(i,1,n)
	{
		read(x[i]),read(y[i]);
		a[++cnt]=node(x[i],i,0);
		a[++cnt]=node(y[i],i,1);
		chkmax(MAX,x[i]),chkmax(MAX,y[i]);
	}
	sort(a+1,a+cnt+1);
	int l=1,r=MAX/(n-1),ans=0;
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(check(mid))ans=mid,l=mid+1;
		else r=mid-1;
	}
	printf("%d\n",ans);
	return 0;
}
