#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define _ << " " <<
#define sz(x) (int)x.size()
#define pb(x) push_back(x)

typedef long long ll;
typedef pair<int, int> point;

const int MAXN = 1e4 + 5;
const int off = 1 << 15;
const int ADD = 2 * off;
const int INF = 1e9;

int n;
int X[MAXN], Y[MAXN], scc[4 * off + 5], iks[MAXN], ips[MAXN];
vector <int> E[4 * off + 5], inv_E[4 * off + 5];
bool bio[4 * off + 5];
stack <int> stek;
vector <point> v;

struct Tournament{

    void addEdge(int x, int val){
        E[x].pb(val + ADD); inv_E[val + ADD].pb(x);
        E[val].pb(x + ADD); inv_E[x + ADD].pb(val);
    }

    void get(int x, int lo, int hi, int a, int b, int val){
        if(lo >= b || hi <= a) return;
        if(lo >= a && hi <= b){ addEdge(x, val); return; }
        int mid = (lo + hi) >> 1;
        get(x * 2, lo, mid, a, b, val);
        get(x * 2 + 1, mid, hi, a, b, val);
    }
}T;

void dfs1(int x){
    bio[x] = true;
    for(auto it : E[x])
        if(!bio[it])
            dfs1(it);
    stek.push(x);
}

void dfs2(int x, int val){
    scc[x] = val;
    for(auto it : inv_E[x])
        if(scc[it] == -1)
            dfs2(it, val);
}

bool check(int mid){
    REP(i, 4 * off + 5){
        E[i].clear(); inv_E[i].clear();
        bio[i] = false; scc[i] = -1;
    }
    for(int i = off - 1; i > 0; --i){
        E[i].pb(i * 2); inv_E[i * 2].pb(i);
        E[i].pb(i * 2 + 1); inv_E[i * 2 + 1].pb(i);
        E[i + ADD].pb(i * 2 + ADD); inv_E[i * 2 + ADD].pb(i + ADD);
        E[i + ADD].pb(i * 2 + 1 + ADD); inv_E[i * 2 + 1 + ADD].pb(i + ADD);
    }

    REP(i, n){
        E[iks[i] + ADD + off].pb(ips[i] + off); inv_E[ips[i] + off].pb(iks[i] + ADD + off);
        E[ips[i] + ADD + off].pb(iks[i] + off); inv_E[iks[i] + off].pb(ips[i] + ADD + off);
        int x = upper_bound(v.begin(), v.end(), point(X[i] - mid, INF)) - v.begin();
        int y = lower_bound(v.begin(), v.end(), point(X[i] + mid, -1)) - v.begin();
        if(x < iks[i]) T.get(1, 0, off, x, iks[i], iks[i] + off);
        if(iks[i] + 1 < y) T.get(1, 0, off, iks[i] + 1, y, iks[i] + off);

        x = upper_bound(v.begin(), v.end(), point(Y[i] - mid, INF)) - v.begin();
        y = lower_bound(v.begin(), v.end(), point(Y[i] + mid, -1)) - v.begin();
        if(x < ips[i]) T.get(1, 0, off, x, ips[i], ips[i] + off);
        if(ips[i] + 1 < y) T.get(1, 0, off, ips[i] + 1, y, ips[i] + off);
    }

    REP(i, 4 * off + 5)
        if(!bio[i])
            dfs1(i);
    int cnt = 0;
    while(!stek.empty()){
        if(scc[stek.top()] == -1)
            dfs2(stek.top(), cnt ++);
        stek.pop();
    }
    //cout << cnt << " cnt\n";
    REP(i, 2 * off + 1)
        if(scc[i] == scc[i + ADD])
            return false;
    return true;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0);

    cin >> n;
    REP(i, n){
        cin >> X[i] >> Y[i];
        v.pb(point(X[i], i)); v.pb(point(Y[i], i));
    }
    sort(v.begin(), v.end());
    REP(i, n){
        iks[i] = lower_bound(v.begin(), v.end(), point(X[i], i)) - v.begin();
        ips[i] = lower_bound(v.begin(), v.end(), point(Y[i], i)) - v.begin();
    }

    int lo = 0, hi = 1e9;
    while(lo < hi){
        int mid = (lo + hi + 1) >> 1;
        if(check(mid))
            lo = mid;
        else
            hi = mid - 1;
    }
    cout << lo;
}


Measured memory_bytes: 38600