#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

#define MAX_V 200010

int V; 
vector<int> G[MAX_V], rG[MAX_V];
vector<int> vs; 

bool vis[MAX_V];
int cmp[MAX_V]; 

void add_edge(int from, int to)
{
	G[from].pb(to);
	rG[to].pb(from);
}

void dfs(int v)
{
	vis[v] = true;

	for (int to : G[v]) {
		if (!vis[to]) dfs(to);
	}

	vs.push_back(v);
}

void rdfs(int v, int k)
{
	vis[v] = true;
	cmp[v] = k;

	for (int to : rG[v]) {
		if (!vis[to]) rdfs(to, k);
	}
}

int scc()
{
	memset(vis, 0, sizeof(vis));
	vs.clear();

	rep(v, V) if (!vis[v]) dfs(v);

	memset(vis, 0, sizeof(vis));

	int k = 0;
	reverse(ALL(vs));

	for (int v : vs) if (!vis[v]) rdfs(v, k++);

		return k;
}

int N;
int x[10010], y[10010];
vector<pii> vec;
int u[10010][2], pp[10010];
int B, sz;

void build(int a, int b, int k, int l, int r, int p) {
	if (b <= l || r <= a) {
		return ;
	}

	if (a <= l && r <= b) {
		add_edge(p, k + B);
		add_edge(k, p + B);
		return ;
	}

	build(a, b, k * 2 + 1, l, (l + r) / 2, p);
	build(a, b, k * 2 + 2, (l + r) / 2, r, p);
}

bool ok(int d)
{
	sz = 1;
	while (sz < N * 2) sz *= 2;

	B = sz * 2;
	V = B * 2;

	rep(i, V) {
		G[i].clear();
		rG[i].clear();
	}

	rep(i, N) {
		int a = u[i][0] + sz - 1, b = u[i][1] + sz - 1;
		add_edge(a, b + B);
		add_edge(b, a + B);
		add_edge(a + B, b);
		add_edge(b + B, a);
	}

	for (int i = 1; i < sz * 2 - 1; ++i) {
		add_edge(i, (i-1) / 2);
		add_edge((i-1) / 2 + B, i + B);
	}

	rep(i, vec.size()) {
		int l = upper_bound(ALL(vec), mp(vec[i].fi - d + 1, -1)) - vec.begin();
		int r = lower_bound(ALL(vec), mp(vec[i].fi + d, -1)) - vec.begin();
		//[l, i), [i + 1, r)
		build(l, i, 0, 0, sz, i + sz - 1);
		build(i + 1, r, 0, 0, sz, i + sz - 1);
	}

	scc();

	rep(i, B) {
		if (cmp[i] == cmp[i + B]) {
			return false;
		}
	}
	return true;
}

int main() {
	cin >> N;

	rep(i, N) {
		cin >> x[i] >> y[i];
		vec.eb(x[i], i * 2);
		vec.eb(y[i], i * 2 + 1);
	}

	sort(ALL(vec));

	rep(i, vec.size()) {
		int id = vec[i].se / 2;
		u[id][pp[id]++] = i;
	}

	int lo = 0, hi = 1000000010;

	while (hi - lo > 1) {
		int mid = (lo + hi) / 2;
		if (ok(mid)) {
			lo = mid;
		} else {
			hi = mid;
		}
	}

	cout << lo << endl;
	
	return 0;
}