#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
    	if(c == '-') f = -1;
    	c = getchar();
    }
    while(c >= '0' && c <= '9') {
    	res = res * 10 +c - '0';
    	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
    	out(x / 10);
    }
    putchar('0' + x % 10);
}
struct tr_node {
    int l,r,lc,rc;
}tr[MAXN * 10];
struct node {
    int to,next;
}E[MAXN * 100];
int sumE,head[MAXN * 10];
int Ncnt,N;
pii val[MAXN * 2];
int p[MAXN][2],pos[MAXN],rt,x[MAXN][2],tot;
void add(int u,int v) {
    E[++sumE].to = v;
    E[sumE].next = head[u];
    head[u] = sumE;
}
void build(int &u,int l,int r) {
    u = ++Ncnt;
    tr[u].l = l;tr[u].r = r;
    if(l == r) {pos[l] = u;return;}
    int mid = (l + r) >> 1;
    build(tr[u].lc,l,mid);
    build(tr[u].rc,mid + 1,r);
    add(u,tr[u].lc);add(u,tr[u].rc);
}

void Add_Range(int u,int l,int r,int v) {
    if(l > r) return;
    if(tr[u].l == l && tr[u].r == r) {add(v,u);return;}
    int mid = (tr[u].l + tr[u].r) >> 1;
    if(r <= mid) Add_Range(tr[u].lc,l,r,v);
    else if(l > mid) Add_Range(tr[u].rc,l,r,v);
    else {Add_Range(tr[u].lc,l,mid,v);Add_Range(tr[u].rc,mid + 1,r,v);}
}
int findL(int v) {
    int l = 1,r = tot;
    while(l < r) {
        int mid = (l + r) >> 1;
        if(x[val[mid].fi][val[mid].se] >= v) r = mid;
        else l = mid + 1;
    }
    return l;
}
int findR(int v) {
    int l = 1,r = tot;
    while(l < r) {
        int mid = (l + r + 1) >> 1;
        if(x[val[mid].fi][val[mid].se] <= v) l = mid;
        else r = mid - 1;
    }
    return l;
}
int dfn[MAXN * 10],low[MAXN * 10],sta[MAXN * 10],top,col[MAXN * 10],idx,instack[MAXN * 10],cor;
void Tarjan(int u) {
    dfn[u] = low[u] = ++idx;
    sta[++top] = u;
    instack[u] = 1;
    for(int i = head[u] ; i ; i = E[i].next) {
        int v = E[i].to;
        if(!dfn[v]) {
            Tarjan(v);
            low[u] = min(low[u],low[v]);
        }
        else if(instack[v] == 1) {
            low[u] = min(low[u],dfn[v]);
        }
    }
    if(low[u] == dfn[u]) {
        ++cor;
        while(1) {
            int x = sta[top--];
            col[x] = cor;
            instack[x] = 2;
            if(x == u) break;
        }
    }
}
bool check(int d) {
    Ncnt = 0,sumE = 0;
    memset(head,0,sizeof(head));
    build(rt,1,tot);
    for(int i = 1 ; i <= tot ; ++i) {
        int u = pos[i];
        p[val[i].fi][val[i].se ^ 1] = u;
    }
    for(int i = 1 ; i <= tot ; ++i) {
        int a,b;
        a = findL(x[val[i].fi][val[i].se] - d + 1);
        b = findR(x[val[i].fi][val[i].se] + d - 1);
        Add_Range(1,a,i - 1,p[val[i].fi][val[i].se]);
        Add_Range(1,i + 1,b,p[val[i].fi][val[i].se]);
    }
    idx = 0;top = 0;cor = 0;
    memset(dfn,0,sizeof(dfn));memset(low,0,sizeof(low));
    memset(col,0,sizeof(col));memset(instack,0,sizeof(instack));
    for(int i = 1 ; i <= N ; ++i) {
        if(!dfn[i]) Tarjan(i);
    }
    for(int i = 1 ; i <= N ; ++i) {
        if(col[p[i][0]] == col[p[i][1]]) return false;
    }
    return true;
}
void Solve() {
    read(N);
    for(int i = 1 ; i <= N ; ++i) {
        read(x[i][0]);read(x[i][1]);
        val[++tot] = mp(i,0);val[++tot] = mp(i,1);
    }
    sort(val + 1,val + tot + 1,[](pii a,pii b){return x[a.fi][a.se] < x[b.fi][b.se];});
    int l = 0,r = 1000000000;
    while(l < r) {
        int mid = (l + r + 1) >> 1;
        if(check(mid)) l = mid;
        else r = mid - 1;
    }
    out(l);enter;
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 36480