// Original C++ solution (slower):
#include <cstdio>

#include <algorithm>

#include <cstring>

using namespace std;



#define clear(x) memset(x, 0, sizeof(x))

#define op(x) ((x) <= n ? (x) + n : (x) - n)

#define mid ((l + r) / 2)

#define ls now * 2

#define rs now * 2 + 1



const int N = 4e4 + 10, M = N * 20;



int hd[N * 5], nxt[M], t[M], ec;

void addEdge(int u, int v) {

    t[++ec] = v;

    nxt[ec] = hd[u];

    hd[u] = ec;

}

struct Flag {

    int pos, id;

    bool operator<(const Flag& f) const { return pos < f.pos; }

    Flag(int pos = 0): pos(pos) {}

} flgs[N * 2];



int n;

int cnt;

int id[N * 5];



void build(int now, int l, int r) {

    id[now] = ++cnt;

    if (l == r) {

        addEdge(id[now], op(flgs[l].id));

        return;

    }

    build(ls, l, mid);

    build(rs, mid + 1, r);

    addEdge(id[now], id[ls]);

    addEdge(id[now], id[rs]);

}



void link(int now, int l, int r, int x, int y, int point) {

    if (y < x) return;

    if (l == x && y == r) addEdge(point, id[now]);

    else if (y <= mid) link(ls, l, mid, x, y, point);

    else if(x > mid) link(rs, mid + 1, r, x, y, point);

    else link(ls, l, mid, x, mid, point), link(rs, mid + 1, r, mid + 1, y, point);

}



#undef mid



int dfn[N * 5], low[N * 5], tim;

int stk[N * 5], tp;

int scc[N * 5], sc;

bool in[N * 5];



void dfs(int u) {

    in[u] = 1;

    dfn[u] = low[u] = ++tim;

    stk[++tp] = u;

    int v;

    for (int i = hd[u]; i; i = nxt[i]) {

        if (!dfn[v = t[i]]) dfs(v), low[u] = min(low[u], low[v]);

        else if (in[v]) low[u] = min(low[u], dfn[v]);

    }

    if (dfn[u] == low[u]) {

        ++sc;

        do {

            scc[v = stk[tp--]] = sc;

            in[v] = 0;

        } while (v != u);

    }

}



bool check(int v) {

    tp = tim = ec = 0;

    clear(hd), clear(dfn), clear(low);

    build(1, 1, cnt = 2 * n);

    int l, r;

    for (int i = 1; i <= 2 * n; i++) {

        l = upper_bound(flgs + 1, flgs + 1 + 2 * n, Flag(flgs[i].pos - v)) - flgs;

        r = upper_bound(flgs + 1, flgs + 1 + 2 * n, Flag(flgs[i].pos + v - 1)) - flgs - 1;

        link(1, 1, 2 * n, l, i - 1, flgs[i].id), link(1, 1, 2 * n, i + 1, r, flgs[i].id);

    }

    for (int i = 1; i <= 2 * n; i++) if (!dfn[i]) dfs(i);

    for (int i = 1; i <= n; i++) if(scc[i] == scc[i + n]) return 0;

    return 1;

}



int main() {

    scanf("%d", &n);

    for (int i = 1; i <= n; i++) {

        scanf("%d%d", &flgs[i].pos, &flgs[i + n].pos);

        flgs[i].id = i, flgs[i + n].id = i + n;

    }



    sort(flgs + 1, flgs + n * 2 + 1);

    

    int l = 0, r = flgs[2 * n].pos - flgs[1].pos + 1, mid, ans;

    while (l <= r) {

        mid = (l + r) / 2;

        if (check(mid)) l = mid + 1, ans = mid;

        else r = mid - 1;

    }



    printf("%d", ans);

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

#define pii pair<int,int> 

#define mp make_pair

using namespace std;

const int mxn=2e4+4;

int A[mxn],B[mxn],X[mxn],n,cnt;

int ord[mxn],scc[mxn],mid;

set<pii>s;

bool used[mxn];

inline void dfs(int a,int x){

	int tx,po;

	if(a<=n)tx=X[a+n],po=a+n;

	else tx=X[a-n],po=a-n;

	used[a]=1;

	s.erase(mp(tx,po));

	for(;s.size();){

		set<pii>::iterator it=s.lower_bound(mp(x-mid+1,-1));

		if(it==s.end() or it->first>x+mid-1)break;

		int y=it->second;

		if(y==a){

			it++;

			if(it==s.end() or it->first>x+mid-1)break;

			y=it->second;

		}

		if(y>n)dfs(y-n,X[y-n]);

		else dfs(y+n,X[y+n]);

	}

	ord[++cnt]=a;

}

inline void dfs2(int a,int x){

	scc[a]=cnt;

	s.erase(mp(x,a));

	int tx;

	if(a<=n)tx=X[a+n];

	else tx=X[a-n];

	for(;s.size();){

		set<pii>::iterator it2=s.lower_bound(mp(tx-mid+1,-1));

		if(it2==s.end() or it2->first>tx+mid-1)break;

		int y=it2->second;

		if(y==a-n or y==a+n){

			it2++;

			if(it2==s.end() or it2->first>tx+mid-1)break;

			y=it2->second;

		}

		dfs2(y,X[y]);

	}

}

inline bool check(int md){

	mid=md,s.clear();

	memset(used,0,sizeof(used));

	memset(scc,0,sizeof(scc));

	for(int i=1;i<=n*2;++i)s.insert(mp(X[i],i));

	cnt=0;

	for(int i=1;i<=n*2;++i)if(!used[i])dfs(i,X[i]);

	cnt=0;

	for(int i=1;i<=n*2;++i)s.insert(mp(X[i],i));

	for(int i=n*2;i;--i){

		if(!scc[ord[i]]){

			++cnt;

			dfs2(ord[i],X[ord[i]]);

		}

	}

	for(int i=1;i<=n;++i)if(scc[i]==scc[i+n])return 0;

	return 1;

}

int main(){

	ios_base::sync_with_stdio(false);

	cin.tie(0),cout.tie(0);

	cin>>n;

	for(int i=1;i<=n;++i){

		cin>>A[i]>>B[i];

		X[i]=A[i],X[i+n]=B[i];

	}

	int lo=0,hi=1000000009,md;

	for(;lo<hi-1;){

		int md=lo+hi>>1;

		if(check(md))lo=md;

		else hi=md; 

	}

	cout<<lo<<endl;

	return 0;

}

// Fastest known solution for this problem: