#include<bits/stdc++.h>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<deque>
#include<list>
#include<set>
#include<vector>
#include<iostream>
#define ll long long
#define re register
//#define inf 0x7f7f7f7f
#define inl inline
#define sqr(x) ((x)*(x))
#define eps 1e-8
#define debug printf("debug\n");
//#define sort system("shutdown -s -t 00");sort
//#pragma comment(linker, "/STACK:1024000000,1024000000")
//#pragma GCC optimize (2)
//#pragma G++ optimize (2)
using namespace std;
//const ll mod=1e9+7;
const ll MAXN=4e4+10;
const ll MAXM=2e6+10;
inl ll read() {
    re ll x = 0; re int f = 1;
    char ch = getchar();
    while(ch<'0'||ch>'9') { if(ch== '-' ) f = -1; ch = getchar(); }
    while(ch>='0'&&ch<='9') {x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
    return x * f;
}
inl char readc() {
    char ch=getchar();
    while(('z'<ch||ch<'a')&&('Z'<ch||ch<'A')) ch=getchar();
    return ch;
}
inl void write(re ll x){
    if(x>=10)write(x/10);
    putchar(x%10+'0');
}
inl void writel(re ll x) {
	if(x<0) {x=-x;putchar('-');}
	write(x); putchar(' ');
}
inl void writeln(re ll x){
    if(x<0) {x=-x;putchar('-');}
    write(x); puts("");
}
inl ll gcd(re ll x,re ll y){while(y^=x^=y^=x%=y);return x;}
inl ll Lcm(re ll a,re ll b) {return a/gcd(a,b)*b;}
inl void FR() {
    freopen(".in","r",stdin);
    freopen(".out","w",stdout);
}
inl void FC() {
    fclose(stdin);
    fclose(stdout);
}
struct edge {
	ll u,v,nxt;
	edge (ll a=0,ll b=0,ll c=0) {u=a,v=b,nxt=c;}
}e[MAXM];
ll head[MAXN<<2],cnt;
inl void adde(ll u,ll v) {
	e[++cnt]=edge(u,v,head[u]);
	head[u]=cnt;
}
ll T_cnt;
struct Node {
	ll l,r,id;
}T[MAXN<<2];
ll peo[MAXN<<2][2];
struct K {
	ll x,id;
	K (ll a=0,ll b=0) {x=a,id=b;}
	bool operator <(const K &ch)const {
		return x==ch.x?id<ch.id:x<ch.x;
	}
}Hash[MAXN<<2];
void build(ll x,ll l,ll r) {
	T[x].l=l,T[x].r=r;
	if(l==r) {T[x].id=Hash[l].id;return ;}
	T[x].id=++T_cnt;
	re ll mid=(l+r)>>1;
	build(x<<1,l,mid);build(x<<1|1,mid+1,r);
	adde(T[x].id,T[x<<1].id);adde(T[x].id,T[x<<1|1].id);
}
ll n,d_cnt,s_cnt;
ll low[MAXN<<2],dfn[MAXN<<2],sta[MAXN<<2],top,in[MAXN<<2];
ll bl[MAXN<<2];
void init() {
	for(re ll i=1;i<=n;i++) {
		Hash[i].x=peo[i][0];
		Hash[i].id=i+n;
		Hash[i+n].x=peo[i][1];
		Hash[i+n].id=i;
	}
	sort(Hash+1,Hash+2*n+1);
}
void add(ll x,ll L,ll R,ll l,ll r,ll aim) {
	if(r<L||l>R) return ;
	if(l<=L&&R<=r) {adde(aim,T[x].id);return ;}
	re ll mid=(L+R)>>1;
	if(l<=mid) add(x<<1,L,mid,l,r,aim);
	if(mid<r) add(x<<1|1,mid+1,R,l,r,aim); 
}
void dfs(ll x) {
	low[x]=dfn[x]=++d_cnt;sta[++top]=x;in[x]=1;
	for(re ll h=head[x];h;h=e[h].nxt) {
		re ll v=e[h].v;
		if(!dfn[v]) {dfs(v),low[x]=min(low[x],low[v]);}
		else if(in[v]) low[x]=min(low[x],dfn[v]);
	}
	if(dfn[x]==low[x]) {
		++s_cnt;
		while(sta[top]!=x) {bl[sta[top]]=s_cnt;in[sta[top]]=0;top--;}
		bl[x]=s_cnt;in[x]=0;top--;
	}
}
bool check(ll x) {
	cnt=0;T_cnt=2*n;
	memset(head,0,sizeof(head));
	build(1,1,2*n);
	for(re ll i=1;i<=n;i++) {
		for(re ll j=0;j<2;j++) {
			re ll l=lower_bound(Hash+1,Hash+2*n+1,K(peo[i][j]-x+1,0))-Hash;
			re ll r=upper_bound(Hash+1,Hash+2*n+1,K(peo[i][j]+x-1,2*n+1))-Hash-1;
			re ll m=lower_bound(Hash+1,Hash+2*n+1,K(peo[i][j],(j^1)*n+i))-Hash;
			add(1,1,2*n,l,m-1,j*n+i);
			add(1,1,2*n,m+1,r,j*n+i);
		}
	}
	top=d_cnt=s_cnt=0;
	memset(low,0,sizeof(low));
	memset(dfn,0,sizeof(dfn));
	memset(bl,0,sizeof(bl));
	memset(in,0,sizeof(in));
	for(re ll i=1;i<=T_cnt;i++) {if(!dfn[i]) dfs(i);}
	for(re ll i=1;i<=n;i++) {
		if(bl[i]==bl[i+n]) return false ;
	}
	return true ;
}
int main() {
//  FR();
	n=read();
	for(re ll i=1;i<=n;i++) {peo[i][0]=read(),peo[i][1]=read();}
	re ll l=0,r=(ll)1e9;init();
	while(l<r) {
		re ll mid=(l+r+1)>>1;
		if(check(mid)) l=mid;
		else r=mid-1;
	}
	writeln(l);
//  FC();
    return 0;
}

Measured memory_bytes: 64384