#include <bits/stdc++.h>
using namespace std;
#define N 300000
int lc[N], rc[N], lb[N], rb[N];
int tot;
vector <int> bi[N];
int intr[N], inS[N];
struct pI
{
    int a, b;
} S[N];
int compa(pI a, pI b) {return a.a < b.a;}

int build_tree(int l, int r)
{
    int t = ++ tot;
    lb[t] = l; rb[t] = r;
    if (l < r)  lc[t] = build_tree(l, (l + r) / 2),
                rc[t] = build_tree((l + r) / 2 + 1, r);
    else intr[S[l].b] = t;
    return t;
}
void put(int t, int l, int r, int d)
{
    if (l > r) return;
    if (l <= lb[t] && rb[t] <= r)
    {
        bi[d].push_back(t);
        return;
    }
    if (l <= rb[lc[t]]) put(lc[t], l, r, d);
    if (r >= lb[rc[t]]) put(rc[t], l, r, d);
}


int dfsnum, dfn[N], low[N], shed[N], inshed[N], top, cnt;
int ini[N];
void init()
{
    dfsnum = 0;
    for (int i = 1; i <= tot * 2; ++ i)
        dfn[i] = low[i] = shed[i] = inshed[i] = ini[i] = 0;
    top = cnt = 0;
}
void dfs(int t)
{
    dfn[t] = low[t] = ++ dfsnum; shed[++ top] = t; inshed[t] = 1;
    for (int i = 0; i < (int)bi[t].size(); ++ i)
        if (!dfn[bi[t][i]])
        {
            dfs(bi[t][i]);
            low[t] = min(low[bi[t][i]], low[t]);
        }
        else if (inshed[bi[t][i]])
            low[t] = min(dfn[bi[t][i]], low[t]);

    if (low[t] == dfn[t])
    {
        int p; cnt ++;
        do
        {
            p = shed[top --];
            inshed[p] = 0;
            ini[p] = cnt;
        }
        while (p != t);
    }
}

int n;
int ai[N];
int main()
{
    cin >> n;
    for (int i = 1; i <= n; ++ i)
        cin >> ai[i] >> ai[i + n];
    for (int i = 1; i <= n * 2; ++ i)
        S[i] = (pI){ai[i], i};

    sort(S + 1, S + n * 2 + 1, compa);
    for (int i = 1; i <= n * 2; ++ i) inS[S[i].b] = i;

    build_tree(1, n * 2);
    int l = 0, r = S[n * 2].a;
    while (l < r)
    {
        int md = (l + r + 1) / 2;

        for (int i = 1; i <= tot * 2; ++ i) bi[i].clear();
        for (int i = 1; i <= tot; ++ i)
        {
            if (lc[i] || rc[i])
                bi[i].push_back(lc[i]),
                bi[i].push_back(rc[i]);
        }

        for (int i = 1; i <= n * 2; ++ i)
        {
            int r = lower_bound(S + 1, S + n * 2 + 1, (pI){ai[i] + md, 0}, compa) - S - 1,
                l = upper_bound(S + 1, S + n * 2 + 1, (pI){ai[i] - md, 0}, compa) - S;

            put(1, l, inS[i] - 1, intr[i <= n? i + n: i - n]);
            put(1, inS[i] + 1, r, intr[i <= n? i + n: i - n]);
        }

        init();
        for (int i = 1; i <= tot * 2; ++ i)
            if (!ini[i]) dfs(i);
        int ok = 1;
        for (int i = 1; i <= n; ++ i)
            if (ini[intr[i]] == ini[intr[i + n]]) ok = 0;

        if (ok) l = md; else r = md - 1;
    }
    cout << l;
}
