#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <stack>
#define N 1000006
#define ls(x) x << 1
#define rs(x) x << 1 | 1

using namespace std;

struct edge{
	int to, nxt;
}e[N];

struct flag{
	int pl, id;

	friend bool operator < (flag a, flag b){
		return a.pl < b.pl;
	}
}x[N];

int n, cnt, ans, tot, num;
int rkx[N], rky[N], fir[N], dfn[N], low[N], co[N];
bool vis[N];

stack < int > st;

int read();
bool cmp(flag, flag);
void build(int ,int ,int);
bool check(int);
void link(int ,int ,int ,int ,int ,int);
void add(int ,int);
void tarjan(int);

int main(){
	n = read();n <<= 1;int l = 0, r = 0;
	for(int i = 0; i < n; ++i) x[i].pl = read(), x[i].id = i, r = max(r, x[i].pl);
	sort(x, x + n);
	for(int i = 0; i < n; ++i) rkx[x[i].id] = i;
	while(l <= r){
		int mid = (l + r) >> 1;
		if(check(mid)) ans = mid, l = mid + 1;
		else r = mid - 1;
	}
	cout << ans << endl;
	return 0;
}

int read(){
	int x = 0;char ch = getchar();
	for(; !isdigit(ch); ch = getchar());
	for(; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
	return x;
}

void add(int u,int v){
	e[++cnt].to = v;e[cnt].nxt = fir[u];fir[u] = cnt;
	return ;
}

void build(int pos,int l,int r){
	if(pos != 1) add(pos >> 1, pos);
	if(l == r){
		rky[l] = pos;return ;
	}
	int mid = (l + r) >> 1;
	build(ls(pos), l, mid);build(rs(pos), mid + 1, r);
	return ;
}

void link(int pos,int l,int r,int nl,int nr, int d){
	if(nl > nr) return ;
	if(l >= nl && r <= nr){
		add(d, pos); return ;
	}
	int mid = (l + r) >> 1;
	if(mid >= nl) link(ls(pos), l, mid, nl, nr, d);
	if(mid < nr) link(rs(pos), mid + 1, r, nl, nr, d);
	return ;
}

bool check(int p){
	num = tot = cnt = 0;
	memset(fir, 0, sizeof fir);memset(vis, false, sizeof vis);memset(dfn, 0, sizeof dfn);
	build(1, 0, (n << 1) - 1);
	for(int i = 0; i < n; ++i){
		add(rky[i], rky[rkx[x[i].id ^ 1] + n]); add(rky[i + n], rky[rkx[x[i].id ^ 1]]);
		int l = upper_bound(x, x + n, (flag){x[i].pl - p, 0}) - x;
		int r = lower_bound(x, x + n, (flag){x[i].pl + p, 0}) - x - 1;
		if(l > r) continue;
		link(1, 0, (n << 1) - 1, l + n, i + n - 1, rky[i]);
		link(1, 0, (n << 1) -1, i + n + 1, r + n, rky[i]);
	}
	for(int i = 0; i < (n << 1); ++i)
		if(!dfn[rky[i]]) tarjan(rky[i]);
	for(int i = 0; i < n; ++i)
		if(co[rky[i]] == co[rky[i + n]]) return false;
	return true;
}

void tarjan(int u){
	low[u] = dfn[u] = ++tot;vis[u] = true;st.push(u);
	for(int i = fir[u]; i; i = e[i].nxt){
		int v = e[i].to;
		if(!dfn[v]) tarjan(v), low[u] = min(low[u], low[v]);
		else if(vis[v]) low[u] = min(low[u], low[v]);
	}
	if(low[u] == dfn[u]){
		++num;
		do{
			co[u] = num;
			u = st.top(); st.pop();vis[u] = false;
		}while(dfn[u] != low[u] && !st.empty());
	}
	return ;
}
