#include<cstdio>
#include<algorithm>
using namespace std;
const int N=100005,M=N<<4,inf=2047483647;
struct node { int y,next; } a[M<<2];
struct node1 { int z,b; } v[2][N];
int t[2][N<<2],st[M],head[M],dfn[M],low[M],B[M],Z[2][N],i,j,k,n,m,g,l,r,d,S,G,T;
bool p[N],f;
char c;

inline char getc()
{
	#define VV 10000000
	static char s[VV],*l=s,*r=s;
	if (l==r)
		l=s,r=s+fread(s,1,VV,stdin);
	return l==r?0:*l++;
}

int read(){ int z=0; do c=getc(); while (c<'0'||c>'9'); while (c>='0'&&c<='9') z*=10,z+=c-'0',c=getc(); return z; }

bool cmp(node1 a,node1 b){ return a.z<b.z; }

void jb(int x,int y)
{
	//printf("%d %d\n",x,y);
	a[++k]=(node){y,head[x]},head[x]=k;
}

void make(int w)
{
	jb(t[0][w],t[0][w<<1]),jb(t[0][w],t[0][w<<1|1]),
	jb(t[1][w],t[1][w<<1]),jb(t[1][w],t[1][w<<1|1]);
}

void build(int w,int L,int R)
{
	if (L==R)
	{
		t[0][w]=v[0][L].b<<1|1,
		t[1][w]=v[1][L].b<<1;
		return;
	}
	t[0][w]=++g,t[1][w]=++g;
	int mid=L+R>>1;
	build(w<<1,L,mid),build(w<<1|1,mid+1,R),
	make(w);
}

void mt(int w,int L,int R)
{
	if (l<=L&&r>=R)
	{
		jb(d,t[f][w]);
		return;
	}
	int mid=L+R>>1;
	if (l<=mid)
		mt(w<<1,L,mid);
	if (r>mid)
		mt(w<<1|1,mid+1,R);
}

bool dfs(int w)
{
	st[++G]=w,dfn[w]=low[w]=++T,p[w]=1;
	//printf("%d %d I\n",G,w);
	for (register int j=head[w];j;j=a[j].next)
	{
		int c=a[j].y;
		if (!dfn[c])
			dfs(c),low[w]=min(low[w],low[c]);
		else
			if (p[c])
				low[w]=min(low[w],dfn[c]);	
	}
	if (dfn[w]==low[w])
	{
		//printf("%d:\n",S+1);
		for (++S,st[G+1]=0;st[G+1]!=w;--G)
			p[st[G]]=0,B[st[G]]=S;//printf("%d ",st[G]);
		//puts("");
	}
}

bool check(int X)
{
	fill(B,B+g+1,0);
	//printf("%d OO:\n",X);
	for (register int j=0;j<2;++j)
		v[j][0].z=-inf,v[j][n+1].z=inf;
	for (register int j=0;j<2;++j)
		for (register int k=0;k<2;++k)
		{
			//printf("%d %d:\n",j,k);
			f=k;
			int x=0,y=0,z;
			for (register int i=1;i<=n;++i)
			{
				//printf("%d R\n",i);
				for (;v[k][x].z<=v[j][i].z-X;++x);
				for (;v[k][y+1].z<v[j][i].z+X;++y);
				//printf("%d %d ?\n",x,y);
				//printf("%d C\n",i);
				if (x<=y)
				{
					d=v[j][i].b<<1|j,z=Z[k][v[j][i].b];
					//printf("%d %d ?\n",d,z);
					if (x<=z&&z<=y)
					{
						if (x<z)
							l=x,r=z-1,mt(1,1,n);
						if (z<y)
							l=z+1,r=y,mt(1,1,n);
					}
					else
						l=x,r=y,mt(1,1,n);
				}
			}
		}
	//printf("%d\n",g);
	//puts("");
	for (register int i=2;i<=g;++i)
		if (!dfn[i])
			T=0,dfs(i),fill(st,st+g+1,0);
	fill(head,head+(n<<1|1)+1,0),fill(dfn,dfn+g+1,0);
	fill(p,p+g+1,0),fill(low,low+g+1,0);
	for (register int i=1;i<=n;++i)
		if (B[i<<1]==B[i<<1|1])
			return 0;
	return 1;
}

void solve()
{
	int l=0,r=0;
	n=read(),g=n<<1|1;
	for (register int i=1;i<=n;++i)
		for (register int j=0;j<2;++j)
			v[j][i]=(node1){read(),i},r=max(r,v[j][i].z);
	for (register int j=0;j<2;++j)
	{
		sort(v[j]+1,v[j]+n+1,cmp);
		for (register int i=1;i<=n;++i)
			Z[j][v[j][i].b]=i;
	}
	/*
	for (register int j=0;j<2;++j)
	{
		printf("%d:\n",j);
		for (register int i=1;i<=n;++i)
			printf("%d %d %d\n",i,v[j][i].z,v[j][i].b);
	}*/
	build(1,1,n);
	int D=k;
	//printf("%d\n",check(2));
	
	while (l<r)
	{
		int mid=l+r+1>>1;
		k=D;
		if (check(mid)) l=mid; else r=mid-1;
	}
	printf("%d\n",l);
}

int main()
{
	//freopen("1.in","r",stdin);
	//freopen("1.out","w",stdout);
	solve();
	return 0;
}

Measured memory_bytes: 26880