// Slower C++ solution:
#include<bits/stdc++.h>

const int N=100007;

int n,pw[N][2],pp=0,mx,L,R,M;

struct pos{

	int x,id,w;

	bool operator<(const pos&p)const{return x<p.x;}

}ps[N*2];

int dfn[N],low[N],scc[N],tk=0,ss[N],sp=0,I[N],tr1[N],tr2[N];

std::vector<int>e[N];

bool in[N];

void mins(int&a,int b){if(a>b)a=b;}

void tj(int w){

	dfn[w]=low[w]=++tk;

	in[ss[++sp]=w]=1;

	for(int i=0;i<e[w].size();++i){

		int u=e[w][i];

		if(!dfn[u]){

			tj(u);

			mins(low[w],low[u]);

		}else if(in[u])mins(low[w],dfn[u]);

	}

	if(dfn[w]==low[w]){

		int u;

		do in[u=ss[sp--]]=0,scc[u]=w;while(u!=w);

	}

}

void ae(int a,int b){

	e[a].push_back(b);

}

void ae1(int w,int l,int r){

	if(l>r)return;

	if(l<=w&&w<=r)ae1(w,l,w-1),ae1(w,w+1,r);

	else for(w+=mx,l+=mx-1,r+=mx+1;r-l>1;l>>=1,r>>=1){

		if(~l&1)ae(w,tr1[l+1]);

		if(r&1)ae(w,tr1[r-1]);

	}

}

void ae2(int w,int l,int r){

	if(l>r)return;

	if(l<=I[w]&&I[w]<=r)ae2(w,l,I[w]-1),ae2(w,I[w]+1,r);

	else for(w+=mx,l+=mx-1,r+=mx+1;r-l>1;l>>=1,r>>=1){

		if(~l&1)ae(tr2[l+1],w);

		if(r&1)ae(tr2[r-1],w);

	}

}

bool chk(){

	for(int i=0;i<mx*3;++i)dfn[i]=0,e[i].clear();

	for(int i=2;i<mx;++i)ae(i/2,i),ae(mx*2+i,mx*2+i/2);

	for(int i=1;i<=pp;++i){

		int j=I[i],l0,r0;

		ae(mx+i>>1,mx+j);

		ae(mx+i,mx*2+(mx+i>>1));

		l0=std::upper_bound(ps+1,ps+pp+1,(pos){ps[i].x-M})-ps;

		r0=std::lower_bound(ps+1,ps+pp+1,(pos){ps[i].x+M})-ps-1;

		ae1(i,l0,r0);

		ae2(j,l0,r0);

	}

	tj(1);

	for(int i=1;i<=n;++i)if(scc[mx+pw[i][0]]==scc[mx+pw[i][1]])return 0;

	return 1;

}

int main(){

	scanf("%d",&n);

	for(int i=1,x,y;i<=n;++i){

		scanf("%d%d",&x,&y);

		ps[++pp]=(pos){x,i,0};

		ps[++pp]=(pos){y,i,1};

	}

	std::sort(ps+1,ps+pp+1);

	for(mx=1;mx<pp+2;mx<<=1);

	for(int i=1;i<=pp;++i)pw[ps[i].id][ps[i].w]=i;

	for(int i=1;i<=pp;++i){

		int x=pw[i][0],y=pw[i][1];

		I[x]=y,I[y]=x;

	}

	for(int i=1;i<mx;++i)tr1[i]=i,tr2[i]=mx*2+i;

	for(int i=1;i<=pp;++i)tr1[mx+i]=mx+I[i],tr2[mx+i]=mx+i;

	L=0,R=1e9;

	while(L<R){

		M=L+R+1>>1;

		if(chk())L=M;

		else R=M-1;

	}

	printf("%d\n",L);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.0905278704878825x):
#include<bits/stdc++.h>

const int N=100007;

int n,pw[N][2],pp=0,mx,L,R,M;

struct pos{

	int x,id,w;

	bool operator<(const pos&p)const{return x<p.x;}

}ps[N*2];

int dfn[N],low[N],scc[N],tk=0,ss[N],sp=0,I[N],tr1[N],tr2[N],ep,e0[N];

struct edge{

	int to,nx;

}e[N*100];

bool in[N];

void mins(int&a,int b){if(a>b)a=b;}

void tj(int w){

	dfn[w]=low[w]=++tk;

	in[ss[++sp]=w]=1;

	for(int i=e0[w];i;i=e[i].nx){

		int u=e[i].to;

		if(!dfn[u]){

			tj(u);

			mins(low[w],low[u]);

		}else if(in[u])mins(low[w],dfn[u]);

	}

	if(dfn[w]==low[w]){

		int u;

		do in[u=ss[sp--]]=0,scc[u]=w;while(u!=w);

	}

}

void ae(int a,int b){

	e[ep]=(edge){b,e0[a]};e0[a]=ep++;

}

void ae1(int w,int l,int r){

	if(l>r)return;

	if(l<=w&&w<=r)ae1(w,l,w-1),ae1(w,w+1,r);

	else for(w+=mx,l+=mx-1,r+=mx+1;r-l>1;l>>=1,r>>=1){

		if(~l&1)ae(w,tr1[l+1]);

		if(r&1)ae(w,tr1[r-1]);

	}

}

void ae2(int w,int l,int r){

	if(l>r)return;

	if(l<=I[w]&&I[w]<=r)ae2(w,l,I[w]-1),ae2(w,I[w]+1,r);

	else for(w+=mx,l+=mx-1,r+=mx+1;r-l>1;l>>=1,r>>=1){

		if(~l&1)ae(tr2[l+1],w);

		if(r&1)ae(tr2[r-1],w);

	}

}

bool chk(){

	for(int i=0;i<mx*3;++i)dfn[i]=0,e0[i]=0;ep=2;

	for(int i=2;i<mx;++i)ae(i/2,i),ae(mx*2+i,mx*2+i/2);

	for(int i=1;i<=pp;++i){

		int j=I[i],l0,r0;

		ae(mx+i>>1,mx+j);

		ae(mx+i,mx*2+(mx+i>>1));

		l0=std::upper_bound(ps+1,ps+pp+1,(pos){ps[i].x-M})-ps;

		r0=std::lower_bound(ps+1,ps+pp+1,(pos){ps[i].x+M})-ps-1;

		ae1(i,l0,r0);

		ae2(j,l0,r0);

	}

	tj(1);

	for(int i=1;i<=n;++i)if(scc[mx+pw[i][0]]==scc[mx+pw[i][1]])return 0;

	return 1;

}

int main(){

	scanf("%d",&n);

	for(int i=1,x,y;i<=n;++i){

		scanf("%d%d",&x,&y);

		ps[++pp]=(pos){x,i,0};

		ps[++pp]=(pos){y,i,1};

	}

	std::sort(ps+1,ps+pp+1);

	for(mx=1;mx<pp+2;mx<<=1);

	for(int i=1;i<=pp;++i)pw[ps[i].id][ps[i].w]=i;

	for(int i=1;i<=pp;++i){

		int x=pw[i][0],y=pw[i][1];

		I[x]=y,I[y]=x;

	}

	for(int i=1;i<mx;++i)tr1[i]=i,tr2[i]=mx*2+i;

	for(int i=1;i<=pp;++i)tr1[mx+i]=mx+I[i],tr2[mx+i]=mx+i;

	L=0,R=1e9;

	while(L<R){

		M=L+R+1>>1;

		if(chk())L=M;

		else R=M-1;

	}

	printf("%d\n",L);

	return 0;

}