#include <bits/stdc++.h>

#define FOR(i,b,e) for(int i=(b); i <= (e); ++i)
#define FORD(i,b,e) for(int i=(b); i >= (e); --i)
#define SIZE(c) (int) (c).size()
#define FORE(i,c) FOR(i,0,SIZE(c)-1)
#define FORDE(i,c) FORD(i,SIZE(c)-1,0)

#define pb push_back
#define mp make_pair
#define st first
#define nd second


using namespace std;

typedef long long ll;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;

typedef vector <int> VI;
typedef vector <bool> VB;
typedef vector <pii> VP;
typedef vector <ll> VL;
typedef vector <pll> VPL;

typedef vector <VI> VVI;
typedef vector <VL> VVL;
typedef vector <VB> VVB;
typedef vector <VP> VVP;

const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000000000000001LL;

/*************************************************************************/

struct Graph {
    VI pos;
    
    set <pii> vert;
    set <pii> negVert;
    
    VB vis;
    
    int d;
    bool rev = false;
    
    Graph(int d): d(d) {}
    
    void addVertex(int p) {
        int id = SIZE(pos);
    
        pos.pb(p);
        vert.insert({p, id});
        negVert.insert({p, id ^ 1});
        vis.pb(false);
    }
    
    int neigh(int v) {
        int p = pos[v ^ rev];
    
        if (rev) {
            auto it = vert.lower_bound({p - d, -1});
            
            if (it != vert.end() && it->nd == (v ^ 1)) {
                it++;
            }
            
            if (it != vert.end() && it->st <= p + d) {
                return it->nd;
            }        
        } else {
            auto it = negVert.lower_bound({p - d, -1});
            
            if (it != negVert.end() && it->nd == (v ^ 1)) {
                it++;
            }
            
            if (it != negVert.end() && it->st <= p + d) {
                return it->nd;
            }
        }
        
        return -1;
    }
    
    void visit(int v) {
        vis[v] = true;
        vert.erase({pos[v], v});
        negVert.erase({pos[v ^ 1], v});
    }
};

/*************************************************************************/

struct SAT2 {
    int n;
    Graph G; VI t;

    SAT2(int n, Graph &G): n(2 * n), G(G), t(2 * n,-1) {}

    void sccV1(int v, Graph &G, VI &V) {
        G.visit(v);

        int u;
        while ((u = G.neigh(v)) != -1) {
            sccV1(u, G, V);
        }

        V.pb(v);
    }

    void sccV2(int v, int nr, Graph &G) {
        G.visit(v);

        t[v] = nr;
        
        int u;
        while ((u = G.neigh(v)) != -1) {
            sccV2(u, nr, G);
        }
    }

    int scc() {
        int nr = -1;

        VI V;
        
        Graph Gt = G;
        Gt.rev = true;

        FOR(i,0,n-1) if (!Gt.vis[i]) {
            sccV1(i, Gt, V);
        }
        
        FORDE(i,V) if (!G.vis[V[i]]) {
            nr++;
            sccV2(V[i], nr, G);
        }

        return nr + 1;
    }

    bool solveSat() {
        int cnt = scc();

        FOR(i,0,n/2-1) if (t[2 * i] == t[2 * i + 1]) {
            return false;
        }

        return true;
    }
};

/*************************************************************************/

bool check(int n, int d, VI &x, VI &y) {
    Graph g(d);
    
    FOR(i,0,n-1) {
        g.addVertex(x[i]);
        g.addVertex(y[i]);
    }

    SAT2 sat(n, g);
    return sat.solveSat();
}

/*************************************************************************/

int main() {
    ios_base::sync_with_stdio(0);
    
    int n;
    cin >> n;
    
    VI x(n), y(n);
    FOR(i,0,n-1) {
        cin >> x[i] >> y[i];
    }
    
    int l = -1, r = 1e9 + 1;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        
        if (check(n, mid, x, y)) {
            l = mid;
        } else {
            r = mid;
        }
    }
    
    cout << r;

    return 0;
}

/*************************************************************************/


Measured memory_bytes: 7004