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

typedef pair<int, int> pii;

int N;
vector<pii> P, X;
vector<vector<int> > adj, pos;
vector<int> tin, bck, id;
stack<int> st;
int timer, scnt;

void dfs(int u) {
    tin[u] = timer++;
    bck[u] = tin[u];
    st.push(u);
    for(int i = 0; i < adj[u].size(); i++) {
        int v = adj[u][i];
        if(tin[v] == -1) {
            dfs(v);
            bck[u] = min(bck[u], bck[v]);
        }
        else if(id[v] == -1) bck[u] = min(bck[u], tin[v]);
    }
    if(bck[u] == tin[u]) {
        while(1) {
            int t = st.top(); st.pop();
            id[t] = scnt;
            if(t == u) break;
        }
        scnt++;
    }
}
void SCC() {
    tin.clear();
    bck.clear();
    id.clear();
    tin = bck = id = vector<int>(16*N, -1);
    timer = scnt = 0;
    for(int i = 0; i < 16*N; i++) if(tin[i] == -1) dfs(i);
}
bool two_sat() {
    for(int i = 0; i < 8*N; i++) if(id[i] == id[8*N + i]) return false;
    return true;
}
void query(int a, int b, int v, int l, int r, int n) {
    if(b < l || r < a) return;
    if(a <= l && r <= b) {
        adj[v].push_back(8*N + n);
        adj[n].push_back(8*N + v);
        return;
    }
    int m = (l + r)>>1;
    query(a, b, v, l, m, 2*n);
    query(a, b, v, m + 1, r, 2*n + 1);
}
int node(int idx, int l, int r, int n) {
    if(idx < l || r < idx) return -1;
    if(l == r) return n;
    int m = (l + r)>>1;
    int L = node(idx, l, m, 2*n);
    int R = node(idx, m + 1, r, 2*n + 1);
    return max(L, R);
}
bool f(int x) {
    adj.clear();
    adj.resize(16*N);

    for(int i = 0; i < N; i++) {
        int a = node(pos[i][0], 0, 2*N - 1, 1);
        int b = node(pos[i][1], 0, 2*N - 1, 1);
        adj[a].push_back(8*N + b);
        adj[8*N + a].push_back(b);
        adj[b].push_back(8*N + a);
        adj[8*N + b].push_back(a);
    }
    for(int i = 1; i < 4*N; i++) {
        adj[2*i].push_back(i);
        adj[8*N + i].push_back(8*N + 2*i);
        adj[2*i + 1].push_back(i);
        adj[8*N + i].push_back(8*N + 2*i + 1);
    }
    for(int i = 0; i < X.size(); i++) {
        int n = node(i, 0, 2*N - 1, 1);
        int s = 0, e = i;
        int l = i;
        while(s <= e) {
            int m = (s + e)>>1;
            if(abs(X[m].first - X[i].first) < x) {
                l = m;
                e = m - 1;
            }
            else s = m + 1;
        }
        s = i, e = X.size() - 1;
        int r = i;
        while(s <= e) {
            int m = (s + e)>>1;
            if(abs(X[m].first - X[i].first) < x) {
                r = m;
                s = m + 1;
            }
            else e = m - 1;
        }
        query(l, i - 1, n, 0, 2*N - 1, 1);
        query(i + 1, r, n, 0, 2*N - 1, 1);
    }
    SCC();
    return two_sat();
}
int main() {
    scanf("%d", &N);
    P.resize(N);
    for(int i = 0; i < N; i++) {
        scanf("%d %d", &P[i].first, &P[i].second);
        X.push_back(pii(P[i].first, i));
        X.push_back(pii(P[i].second, i));
    }
    sort(X.begin(), X.end());
    pos.resize(N);
    for(int i = 0; i < X.size(); i++) {
        pos[ X[i].second ].push_back(i);
    }

    int s = 0, e = 1e9;
    int d;
    while(s <= e) {
        int m = (s + e)>>1;
        if(f(m)) {
            d = m;
            s = m + 1;
        }
        else e = m - 1;
    }
    printf("%d", d);
}


Measured memory_bytes: 24624