#include <cstdio>
#include <algorithm>
using namespace std;

#define iter(i, n) for (int i = 1; i <= n; ++i)
#define iter_e(i, x) for (int i = pos[x]; i; i = g[i].frt)

typedef pair<int, int> pii;
#define fi first
#define se second

#define lx x << 1
#define rx x << 1 | 1
#define RT 1, 1, len
#define SL lx, l, mid
#define SR rx, mid + 1, r

const int PR = 1010000;
const int NR = 2e5 + 20;

struct Edge { int y, frt; } g[5010000];
int pos[PR], gsz, dsz, psz, dfn[PR], low[PR], a[NR], b[NR], ind[NR][2], t[NR << 2], stk[PR], top, p[NR][2];
pii li[NR];
int n, len, bel[PR], lf[NR];

int P(int x, bool d) { return x * 2 + d; }

void AE(int x, int y) { g[++gsz] = (Edge) { y, pos[x] }, pos[x] = gsz; }
void link(int x, int y) { 
	//printf("%d %d\n", x, y);
	AE(x, y); AE(y ^ 1, x ^ 1); }

void build(int x, int l, int r) {
	t[x] = ++psz;
	if (l == r) { lf[l] = psz; return; }
	int mid = (l + r) / 2;
	build(SL); build(SR);
	link(P(t[x], 0), P(t[lx], 0));
	link(P(t[x], 0), P(t[rx], 0));
}

void modify(int x, int l, int r, int ml, int mr, int d) {
	if (ml > mr) return;
	if (ml <= l && r <= mr) { link(P(d, 1), P(t[x], 0)); return; }
	int mid = (l + r) / 2;
	if (ml <= mid) modify(SL, ml, mr, d);
	if (mr > mid) modify(SR, ml, mr, d);
}

#define v g[i].y

void tarjan(int x) {
	dfn[x] = low[x] = ++dsz;
	stk[++top] = x;
	iter_e(i, x) {
	//	printf("e%d %d\n", x, v);
		if (!dfn[v]) tarjan(v), low[x] = min(low[x], low[v]);
		else if (!bel[v]) low[x] = min(low[x], dfn[v]);
	}

	//printf("%d: %d %d\n", x, dfn[x], low[x]);

	if (low[x] == dfn[x]) {
		int y;
		do { y = stk[top--]; bel[y] = x;
	//	printf("b%d: %d\n", y, x);
		 } while(y != x);
	}
}

bool check(int D) {
	iter(i, psz * 2 + 2) pos[i] = dfn[i] = low[i] = bel[i] = 0;
	psz = gsz = dsz = 0;
	build(RT);

	iter(i, n) {
		p[i][0] = ++psz;
		p[i][1] = ++psz;

	//	printf("!!\n");
		link(P(p[i][0], 0), P(p[i][1], 1));
		link(P(p[i][1], 0), P(p[i][0], 1));
		link(P(lf[ind[i][0]], 0), P(p[i][0], 0));
		link(P(lf[ind[i][1]], 0), P(p[i][1], 0));

		int l = lower_bound(li + 1, li + len + 1, pii(a[i] - D, 0)) - li;
		int r = upper_bound(li + 1, li + len + 1, pii(a[i] + D + 1, 0)) - li - 1;

	//	printf("!%d %d %d %d\n", i, D, l, r);

		modify(RT, l, ind[i][0] - 1, p[i][0]);
		modify(RT, ind[i][0] + 1, r, p[i][0]);

		l = lower_bound(li + 1, li + len + 1, pii(b[i] - D, 0)) - li;
		r = upper_bound(li + 1, li + len + 1, pii(b[i] + D + 1, 0)) - li - 1;

		modify(RT, l, ind[i][1] - 1, p[i][1]);
		modify(RT, ind[i][1] + 1, r, p[i][1]);
	}

	iter(i, 2 * psz + 2) if (dfn[i] == 0) tarjan(i);
	//printf("top !!%d\n", top);
	//iter(i, psz) {
	//	printf("[%d %d] ", bel[P(i,0)], bel[P(i,1)]);
	//} puts("");
	iter(i, psz) if (bel[P(i, 0)] == bel[P(i, 1)]) return false;
	return true;
}

int main() {
//	freopen("69F.in", "r", stdin);
	scanf("%d", &n);
	iter(i, n) scanf("%d%d", &a[i], &b[i]), li[++len] = pii(a[i], i * 2), li[++len] = pii(b[i], i * 2 + 1);
	sort(li + 1, li + len + 1);

	iter(i, len) ind[li[i].se / 2][li[i].se % 2] = i;

	if (!check(0)) {
		puts("0"); return 0;
	}

	int l = 0, r = 1e9;
	for (; l < r;) {
		int mid = (l + r + 1) / 2;
		if (check(mid)) l = mid;
		else r = mid - 1;
	}
	printf("%d\n", l + 1);

//	iter(i, len) printf("%d ", li[i].fi); puts("");
	return 0;
}


Measured memory_bytes: 36096