#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
typedef vector<int>vi;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define fi first
#define se second
#define de(x) cout<<#x<<"="<<x<<"\n"
#define dd(x) cout<<#x<<"="<<x<<" "
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define lowbit(a) ((a)&-(a))
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
const int N=2e5+5;
int n;
pii p[N]; 
struct TwoSat{
	static const int N = ::N<<3;
	int dfn[N] , low[N],id[N],st[N],_st,_,cc,ba,to[N];
	vi g[N];
	int mark[N],n;
	void init(int _n){rep(i , 0 , (n = _n<<1))g[i].clear();}
	int newnode(){
		rep(i , 0 , 2)g[n++].clear();
		return n - 2;
	}
	void addedge(int a,  int b) {   
		g[a].pb(b); g[b ^ 1].pb(a ^ 1);
	} 
	void build(int l,int r,int rt){
		to[rt] = newnode();
		if(l == r){
			addedge(to[rt],p[l].se^1 );
			return;
		}
		int m = l + r>>1;
		build(l , m , rt<<1);
		build(m + 1,r,rt<<1|1);
		addedge(to[rt],to[rt<<1]);
		addedge(to[rt],to[rt<<1|1]);
	}
	void add(int u,int L,int R,int l,int r,int rt){
		if(L <= l && r <= R){
			addedge(u , to[rt]);
			return;
		}
		int m = l + r>>1;
		if(L <= m)add(u , L , R ,l , m , rt<<1);
		if(R > m)add(u , L , R ,m + 1, r , rt<<1|1); 
	}
	void dfs(int c,vi g[]){
		dfn[c] = low[c] = ++cc;
		st[_st++] = c;
		for(auto t : g[c])
			if(!dfn[t])dfs(t,g),low[c] = min(low[c],low[t]);
			else if(!id[t])low[c] = min(low[c],dfn[t]);
		if(low[c] == dfn[c]){
			++_;
			do{id[st[--_st]] = _;}while(st[_st] != c);
		}
	}
	void find(){
		fill_n(dfn,n,cc= 0);
		fill_n(low,n,_st = 0);
		fill_n(id , n,_ = 0);
		rep(i , 0 , n)if(!dfn[i])dfs(i , g);
		rep(i , 0 , n)--id[i];
		return;
	}
	bool solve(){
		find();
		for(int i = 0;i < n;i += 2){
			if(id[i] == id[i + 1])return 0;
			mark[i >>1] = (id[i] > id[i + 1]);
		}
		return 1;	
	}
}ts;
bool ck(int d){
	d--;
	ts.init(n);
	ts.build(0 , 2*n - 1,1);
	for(int i = 0 ;i < 2*n;i++){
		int l , r;
		l = lower_bound(p , p + 2*n , pii(p[i].fi - d,0)) - p;
		r = lower_bound(p , p + 2*n , pii(p[i].fi + d,0)) - p - 1;
	//	dd(i),dd(p[i].fi),dd(p[i].se),dd(l),de(r); 
		if(l < i)ts.add(p[i].se , l , i - 1, 0 , 2*n - 1, 1);
		if(r > i)ts.add(p[i].se , i + 1, r , 0 , 2*n - 1, 1);
	}
	if(ts.solve())return true;
	return false;
}
int main()
{
	scanf("%d",&n);
	rep( i ,0  , 2*n){
		 scanf("%d",&p[i].fi);
		 p[i].se = i;
	} 
	sort(p,p + 2*n);
	int ans = 0 ,L = 1,R = 1e9;
	while(L <= R){
		int mid = (L + R)>>1;
		if(ck(mid)){
			ans = mid;
			L = mid + 1; 
		}
		else R = mid - 1;
	}
	
	printf("%d\n",ans);
	return 0;
}


