#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#define debug(x) cerr << #x << ':' << (x) << '\n'
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }

class SCC {
	vector<vector<int>> graph;
	vector<vector<int>> revgraph;
	vector<int> vs;
	vector<bool> used;
public:
	vector<int> cmp;
	SCC(int n) {
		graph = revgraph = vector<vector<int>>(n, vector<int>());
		vs = cmp = vector<int>(n);
		used = vector<bool>(n);
	}
	void add_edge(int from, int to) {
		graph[from].push_back(to);
		revgraph[to].push_back(from);
	}
	void add_edge(int from, int a, int b, int s) {
		a += s; b += s;
		while (a < b) {
			if (a & 1) add_edge(from, s + (a++));
			if (b & 1) add_edge(from, s + (--b));
			a >>= 1; b >>= 1;
		}
	}
	void dfs(int v) {
		used[v] = true;
		for (int i : graph[v]) {
			if (!used[i]) dfs(i);
		}
		vs.push_back(v);

	}
	void rdfs(int v, int k) {
		used[v] = true;
		cmp[v] = k;
		for (int i : revgraph[v]) {
			if (!used[i]) rdfs(i, k);
		}
	}
	int solve() {
		int n = graph.size();
		for (int i = 0; i < n; i++) used[i] = false;
		vs.clear();
		for (int v = 0; v < n; v++) {
			if (!used[v]) dfs(v);
		}
		for (int i = 0; i < n; i++) used[i] = false;
		int k = 0;
		for (int i = n - 1; i >= 0; i--) {
			if (!used[vs[i]]) rdfs(vs[i], k++);
		}
		return k;
	}
};

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	int n;
	cin >> n;
	vector<P> p(n);
	rep(i, n) cin >> p[i].first >> p[i].second;
	vector<P> check(2 * n);
	rep(i, n) {
		check[2 * i] = { p[i].first,2 * i };
		check[2 * i + 1] = { p[i].second,2 * i + 1 };
	}
	sort(all(check));
	vector<int> r(2 * n);
	rep(i, 2 * n) {
		r[check[i].second] = i;
	}
	int sz = 1;
	while (sz < n) sz <<= 1;
	SCC pre(6 * sz);
	rep(i, n) {
		pre.add_edge(r[2 * i] + 4 * sz, r[2 * i + 1]);
		pre.add_edge(r[2 * i + 1] + 4 * sz, r[2 * i]);
	}
	for (int i = 1; i < 2 * sz; i++) {
		pre.add_edge(i + 2 * sz, 2 * i + 2 * sz);
		pre.add_edge(i + 2 * sz, 2 * i + 1 + 2 * sz);
	}
	int ok = 0, ng = inf;
	while (ng - ok > 1) {
		int d = (ok + ng) / 2;
		SCC scc = pre;
		rep(i, 2 * n) {
			int s = 2 * sz;
			P p = { check[i].first + d ,-1 };
			int idx = lower_bound(all(check), p) - check.begin();
			scc.add_edge(i, i + 1, idx, s);
			p = { check[i].first - d,inf };
			int idx2 = upper_bound(all(check), p) - check.begin();
			scc.add_edge(i, idx2, i, s);
		}
		scc.solve();
		bool flag = true;
		rep(i, 2 * n) {
			if (scc.cmp[i] == scc.cmp[i + 4 * sz]) flag = false;
		}
		if (flag) ok = d;
		else ng = d;
	}
	cout << ok << '\n';
}

Measured memory_bytes: 36564