#include<bits/stdc++.h>
#define X first
#define Y second
using namespace std;
const int inf = 1e9;

int n, bas, bel[100005], cc;
bool vis[100005];

vector<int> adj[100005], rev[100005], ind[10005], post;
vector<pair<int,int> > ord;

void addedge (int A, int B) {
	adj[A].push_back(B);
	rev[B].push_back(A);
}

void addedge (int A, int S, int E) {
	S += bas; E += bas;
	while(S<=E) {
		if(S%2==1) addedge(A, S++);
		if(E%2==0) addedge(A, E--);
		S>>=1; E>>=1;
	}
}

void dfs (int cur) {
	if(vis[cur]) return;
	vis[cur] = true;
	for(auto &nxt : adj[cur]) dfs(nxt);
	post.push_back(cur);
}

void rdfs (int cur) {
	if(!vis[cur]) return;
	bel[cur] = cc;
	vis[cur] = false;
	for(auto &nxt : rev[cur]) rdfs(nxt);
}

int getidx (int val) {
	return lower_bound(ord.begin(), ord.end(), make_pair(val, -inf)) - ord.begin();
}

bool can (int piv) {
	for(int i=1;i<2*bas;i++) {
		adj[i].clear();
		rev[i].clear();
	}
	for(int i=1;i<bas;i++) {
		addedge(i, 2*i);
		addedge(i, 2*i+1);
	}
	for(int i=1;i<=n;i++) {
		addedge(ind[i][1] + bas, getidx(ord[ind[i][0]].X-piv+1), ind[i][0]-1);
		addedge(ind[i][1] + bas, ind[i][0] + 1, getidx(ord[ind[i][0]].X+piv)-1);
		addedge(ind[i][0] + bas, getidx(ord[ind[i][1]].X-piv+1), ind[i][1]-1);
		addedge(ind[i][0] + bas, ind[i][1] + 1, getidx(ord[ind[i][1]].X+piv)-1);
	}
	post.clear(); cc = 0;
	for(int i=1; i<2*bas; i++) dfs(i);
	for(int i=2*bas-1; i--; ) {
		if(vis[post[i]]) {cc++; rdfs(post[i]);}
	}
	for(int i=1;i<=n;i++) {
		if(bel[ind[i][0]+bas] == bel[ind[i][1]+bas]) return false;
	}
	return true;
}

int main()
{
	scanf("%d",&n);
	for(bas = 1; bas <= 2*n; bas <<= 1);
	for(int i=1;i<=n;i++) {
		int A, B;
		scanf("%d%d",&A,&B);
		ord.push_back({A, i});
		ord.push_back({B, i});
	}
	sort(ord.begin(), ord.end());
	for(int i=0;i<ord.size();i++) {
		ind[ord[i].Y].push_back(i);
	}
	int S = 0, E = inf;
	while(S<E) {
		int mid = (1ll * S + E) / 2 + 1;
		can(mid) ? S = mid : E = mid-1;
	}
	printf("%d\n",S);
}
