#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
#define fs first
#define se second

using namespace std;
typedef long long llong;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<llong, llong> pll;
typedef pair<ld, ld> pdd;

int n;
int x[10000][2];
int V[1 << 16];
vector<pii> comp;
int sz;
vector<int> edge[1 << 16];
vector<int> redge[1 << 16];
int init(int i, int s, int e) {
    if (s == e) return V[i] = ~comp[s].se + n;
    V[i] = sz++;
    int m = (s + e) / 2;
    int L = init(i << 1, s, m);
    int R = init(i << 1 | 1, m + 1, e);
    edge[V[i]].push_back(L);
    edge[V[i]].push_back(R);
    return V[i];
}

void add_edge(int i, int s, int e, int x, int y, int v) {
    if (e < x || y < s) return;
    if (x <= s && e <= y) {
        edge[v + n].push_back(V[i]);
        return;
    }
    int m = (s + e) / 2;
    add_edge(i << 1, s, m, x, y, v);
    add_edge(i << 1 | 1, m + 1, e, x, y, v);
}

int vis[1 << 16];
int scc[1 << 16];
vector<int> st;
void dfs1(int x) {
    vis[x] = 1;
    for (int i : redge[x]) {
        if (vis[i]) continue;
        dfs1(i);
    }
    st.push_back(x);
}

void dfs2(int x, int c) {
    scc[x] = c;
    for (int i : edge[x]) {
        if (scc[i]) continue;
        dfs2(i, c);
    }
}

int check(int d) {
    st.clear();
    for (int i = 0; i < (1 << 16); ++i) edge[i].clear(), redge[i].clear(), vis[i] = scc[i] = 0;
    sz = n + n;
    init(1, 0, n + n - 1);
    for (int i = 0, j = 0, k = 0; i < n + n; ++i) {
        while (comp[j].fs <= comp[i].fs - d) ++j;
        while (k + 1 < n + n && comp[k + 1].fs < comp[i].fs + d) ++k;
        add_edge(1, 0, n + n - 1, j, i - 1, comp[i].se);
        add_edge(1, 0, n + n - 1, i + 1, k, comp[i].se);
    }
    for (int i = 0; i < sz; ++i) {
        for (int j : edge[i]) {
            redge[j].push_back(i);
        }
    }
    for (int i = 0; i < sz; ++i) {
        if (vis[i]) continue;
        dfs1(i);
    }
    int ord = 0;
    for (int i = sz; i--; ) {
        if (scc[st[i]]) continue;
        dfs2(st[i], ++ord);
    }
    for (int i = 0; i < n; ++i) {
        if (scc[i + n] == scc[~i + n]) return 0;
    }
    return 1;
}
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> x[i][0] >> x[i][1];
        comp.emplace_back(x[i][0], i);
        comp.emplace_back(x[i][1], ~i);
    }
    sort(comp.begin(), comp.end());
    int s = 0, e = 1e9;
    while (s < e) {
        int m = (s + e + 1) / 2;
        if (check(m)) s = m;
        else e = m - 1;
    }
    printf("%d\n", s);
    return 0;
}