#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <bitset>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#define PR pair
#define fi first
#define se second
#define mk make_pair
#define pb push_back
#define REP(i, x, y)   for(int i = (int)(x); i <= (int)(y); i++)
#define FOR(i, x, y)   for(int i = (int)(x); i <  (int)(y); i++)
#define PER(i ,x, y)   for(int i = (int)(x); i >= (int)(y); i--)
#define CH	         ch = getchar()
#define Exit(...)    printf(__VA_ARGS__), exit(0)
#define dln()        fprintf(stderr,"\n")
#define dprintf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
typedef double	  db;
typedef long long LL;
typedef vector<int> VI;
typedef vector<VI > VII;
typedef PR<int,int> PII;
typedef vector<PII> VPI;
const	int inf=2e9;
const	LL Inf=1e10;
const	int P=1e9+7;
const	int N=1000005;

inline LL IN(){
	LL x = 0;
	int ch = 0, f = 0;
	for (CH; ch != -1 && (ch < 48 || ch > 57); CH) f = (ch == '-');
	for (; ch >= 48 && ch <= 57; CH) x = (x << 1) + (x << 3) + ch - '0';
	return f ? (-x) : x;
}
template<typename T> inline int chkmin(T &a, const T &b){if(b < a) return a = b, 1; return 0;}
template<typename T> inline int chkmax(T &a, const T &b){if(b > a) return a = b, 1; return 0;}

void renew(int &x, const int &y){
	x += y;
	if(x >= P) x -= P;
	if(x <  0) x += P;
}

int Pow(int x, int y, int p){
	int a = 1;
	for (; y; y >>= 1, x = (LL)x * x %p) if(y & 1) a=(LL)a * x%p;
	return a;
}


int n, tot;
int tid[N], cnt;
struct node{
	int x, id, rid;
	int operator <(const node &a)const{
		return x < a.x;
	}
}a[N];
struct edge{
	int v, pre;
}e[4000005]; int dex, adj[N];
int key[N];

void B(int x, int L, int R){
	tid[x] = ++cnt;
	if(L == R) return;
	int md = (L + R) >> 1;
	B(x << 1, L, md);
	B((x << 1) | 1, md + 1, R);
}

void add(int x, int y){
	e[++dex] = (edge){y, adj[x]}; adj[x] = dex;
}

void Make(int x, int L, int R){
	if(L == R){
		add(tid[x], a[L].rid);
		return;
	}
	add(tid[x], tid[x << 1]);
	add(tid[x], tid[(x << 1) | 1]);
	int md = (L + R) >> 1;
	Make(x << 1, L, md);
	Make((x << 1) | 1, md + 1, R);
}

void A(int x, int L, int R, int ql, int qr, int qx){
	if(ql <= L && R <= qr){
		add(qx, tid[x]);
		return;
	}
	int md = (L + R) >> 1;
	if(ql <= md) A(x << 1, L, md, ql, qr, qx);
	if(md <  qr) A((x << 1) | 1, md + 1, R, ql, qr, qx);
}

int tim, scc_cnt;
int In[N], stk[N], top, dfn[N], low[N], col[N];
void tarjan(int x){
	dfn[x] = low[x] = ++tim;
	In[stk[++top] = x] = 1;
	for(int i = adj[x]; i; i = e[i].pre){
		int v = e[i].v;
		if(!dfn[v]){
			tarjan(v);
			low[x] = min(low[x], low[v]);
		}else if(In[v]) low[x] = min(low[x], dfn[v]);
	}
	if(low[x] == dfn[x]){
		int p;
		++scc_cnt;
		do{
			p = stk[top];
			col[p] = scc_cnt;
			In[p] = 0;
			--top;
		}while(p != x);
	}
}

int check(int x){
	x --;
	REP(i, 1, cnt) adj[i] = 0; dex = tim = 0;
	REP(i, 1, cnt) stk[i] = In[i] = dfn[i] = low[i] = 0; top = 0;
	Make(1, 1, tot);
	REP(i, 1, tot){
		int xl = lower_bound(key + 1, key + tot + 1, a[i].x - x) - key;
		int xr = upper_bound(key + 1, key + tot + 1, a[i].x + x) - key - 1;
		if(xl < i) A(1, 1, tot, xl, i - 1, a[i].id);
		if(i < xr) A(1, 1, tot, i + 1, xr, a[i].id);
//		REP(j, 1, tot) if(abs(key[j] - key[i]) <= x && j != i && a[i].id != a[j].rid) add(a[i].id, a[j].rid);
	}
	scc_cnt = 0;
	REP(i, 1, cnt) col[i] = 0;
	REP(i, 1, cnt) if(!dfn[i]) tarjan(i);
	REP(i, 1, tot) if(col[a[i].id] == col[a[i].rid]) return 0;
	return 1;
}

int main(){
	scanf("%d", &n);
	REP(i, 1, n){
		int x, y;
		scanf("%d%d", &x, &y);
		++tot; a[tot] = (node){x, tot, tot + 1};
		++tot; a[tot] = (node){y, tot, tot - 1};
	}
	cnt = tot;
	sort(a + 1, a + tot + 1);
	REP(i, 1, tot) key[i] = a[i].x;
	B(1, 1, tot);
	int L = 0, R = 1e9, aim = L;
	while(L <= R){
		int md = (L + R) >> 1;
		if(check(md)){
			aim = md;
			L = md + 1;
		}else{
			R = md - 1;
		}
	}
	printf("%d\n", aim);
	return 0;
}




















Measured memory_bytes: 29184