// Slower C++ solution:
#include <cstdio>

#include <algorithm>

#include <cstring>

using namespace std;



#define clear(x) memset(x, 0, sizeof(x))

#define op(x) ((x) <= n ? (x) + n : (x) - n)

#define mid ((l + r) / 2)

#define ls now * 2

#define rs now * 2 + 1



const int N = 4e4 + 10, M = N * 20;



int hd[N * 5], nxt[M], t[M], ec;

void addEdge(int u, int v) {

    t[++ec] = v;

    nxt[ec] = hd[u];

    hd[u] = ec;

}

struct Flag {

    int pos, id;

    bool operator<(const Flag& f) const { return pos < f.pos; }

    Flag(int pos = 0): pos(pos) {}

} flgs[N * 2];



int n;

int cnt;

int id[N * 5];



void build(int now, int l, int r) {

    id[now] = ++cnt;

    if (l == r) {

        addEdge(id[now], op(flgs[l].id));

        return;

    }

    build(ls, l, mid);

    build(rs, mid + 1, r);

    addEdge(id[now], id[ls]);

    addEdge(id[now], id[rs]);

}



void link(int now, int l, int r, int x, int y, int point) {

    if (y < x) return;

    if (l == x && y == r) addEdge(point, id[now]);

    else if (y <= mid) link(ls, l, mid, x, y, point);

    else if(x > mid) link(rs, mid + 1, r, x, y, point);

    else link(ls, l, mid, x, mid, point), link(rs, mid + 1, r, mid + 1, y, point);

}



#undef mid



int dfn[N * 5], low[N * 5], tim;

int stk[N * 5], tp;

int scc[N * 5], sc;

bool in[N * 5];



void dfs(int u) {

    in[u] = 1;

    dfn[u] = low[u] = ++tim;

    stk[++tp] = u;

    int v;

    for (int i = hd[u]; i; i = nxt[i]) {

        if (!dfn[v = t[i]]) dfs(v), low[u] = min(low[u], low[v]);

        else if (in[v]) low[u] = min(low[u], dfn[v]);

    }

    if (dfn[u] == low[u]) {

        ++sc;

        do {

            scc[v = stk[tp--]] = sc;

            in[v] = 0;

        } while (v != u);

    }

}



bool check(int v) {

    tp = tim = ec = 0;

    clear(hd), clear(dfn), clear(low);

    build(1, 1, cnt = 2 * n);

    int l, r;

    for (int i = 1; i <= 2 * n; i++) {

        l = upper_bound(flgs + 1, flgs + 1 + 2 * n, Flag(flgs[i].pos - v)) - flgs;

        r = upper_bound(flgs + 1, flgs + 1 + 2 * n, Flag(flgs[i].pos + v - 1)) - flgs - 1;

        link(1, 1, 2 * n, l, i - 1, flgs[i].id), link(1, 1, 2 * n, i + 1, r, flgs[i].id);

    }

    for (int i = 1; i <= 2 * n; i++) if (!dfn[i]) dfs(i);

    for (int i = 1; i <= n; i++) if(scc[i] == scc[i + n]) return 0;

    return 1;

}



int main() {

    scanf("%d", &n);

    for (int i = 1; i <= n; i++) {

        scanf("%d%d", &flgs[i].pos, &flgs[i + n].pos);

        flgs[i].id = i, flgs[i + n].id = i + n;

    }



    sort(flgs + 1, flgs + n * 2 + 1);

    

    int l = 0, r = flgs[2 * n].pos - flgs[1].pos + 1, mid, ans;

    while (l <= r) {

        mid = (l + r) / 2;

        if (check(mid)) l = mid + 1, ans = mid;

        else r = mid - 1;

    }



    printf("%d", ans);

}

// Faster C++ solution for the same problem (measured speedup: 2.447368846676194x):
// AT2336 Flags

#include <iostream>

#include <cstdio>

#include <cstring>

#include <algorithm>

#define RI register int

using namespace std;

const int N = 4e4 + 5;

pair <int, int> e[N<<1];

int tot, scc_cnt, node_cnt, a[2][N], n, tp, sta[N<<1], low[N<<2], dfn[N<<2], scc[N<<2];

int cnt, head[N<<2], to[N<<5], nxt[N<<5];

template <class T> T Max(T a, T b) { return a > b ? a : b; }

template <class T> T Min(T a, T b) { return a < b ? a : b; }

inline int read() {

    int x = 0, f = 1; char ch;

    while(! isdigit(ch = getchar())) (ch == '-') && (f = -f);

    for(x = ch^48; isdigit(ch = getchar()); x = (x<<3) + (x<<1) + (ch^48));

    return x * f;

}

inline void add(int u, int v) {

    to[++ cnt] = v; nxt[cnt] = head[u]; head[u] = cnt;

}

struct Segment_Tree {

    struct node {

        int l, r, val;

        node *ch[2];

        node(int l, int r) : l(l), r(r) {

            val = 0;

            ch[0] = ch[1] = NULL;

        }

        inline int mid() { return (l + r) >> 1; }

    } *root;

    void build(node *&o, int l, int r) {

        o = new node(l, r);

        if(l == r) {

            o->val = e[l].second;

            return;

        }

        o->val = ++ node_cnt;

        build(o->ch[0], l, o->mid());

        build(o->ch[1], o->mid() + 1, r);

        add(o->val, o->ch[0]->val);

        add(o->val, o->ch[1]->val);

    }

    void link(node *o, int l, int r, int u) {

        if(r < l) return;

        if(l <= o->l && o->r <= r) {

            add(u, o->val);

            return;

        }

        if(l <= o->mid()) link(o->ch[0], l, r, u);

        if(r > o->mid()) link(o->ch[1], l, r, u);

    }

} tr;

inline void Tarjan(int x) {

    low[x] = dfn[x] = ++ tot;

    sta[++ tp] = x;

    for(RI i = head[x]; i; i = nxt[i]) {

        if(! dfn[to[i]]) {

            Tarjan(to[i]);

            low[x] = Min(low[x], low[to[i]]);

        }

        else if(scc[to[i]] == 0) {

        	low[x] = Min(low[x], dfn[to[i]]);

        }

    }

    if(dfn[x] == low[x]) {

    	int t; scc_cnt ++;

    	do {

    		t = sta[tp --];

    		scc[t] = scc_cnt;

    	} while(t != x);

    }

}

inline bool check(int x) {

    cnt = tot = scc_cnt = tp = 0; node_cnt = 2 * n;

    memset(head, 0, sizeof(head));

    tr.build(tr.root, 1, 2 * n);

    for(RI i = 1; i <= n; ++ i) {

        for(RI k = 0; k <= 1; ++ k) {

            int l = lower_bound(e + 1, e + 2*n + 1,make_pair(a[k][i]-x+1, 0)) - e;

            int r = upper_bound(e + 1, e + 2*n + 1,make_pair(a[k][i]+x-1, 2*n+1)) - e - 1;

            int m = lower_bound(e + 1, e + 2*n + 1,make_pair(a[k][i], (k^1)*n+i)) - e;

            tr.link(tr.root, l, m - 1, k * n + i);

            tr.link(tr.root, m + 1, r, k * n + i);

        }

    }

    for(int i = 1; i <= node_cnt; ++ i) {

    	dfn[i] = low[i] = scc[i] = 0;

    }

    for(RI i=1;i<=node_cnt;i++) {

        if(!dfn[i]) Tarjan(i);

    }

    for(RI i=1;i<=n;i++) {

        if(scc[i]==scc[i+n]) return 0;

    }

    return 1;

}

int main() {

    cin >> n;

    for(RI i = 1; i <= n; ++ i) {

        cin >> a[0][i] >> a[1][i];

    }

    for(RI i = 1; i <= n; ++ i) {

        e[2*i - 1].first = a[0][i];

        e[2*i - 1].second = i + n;

        e[2*i].first = a[1][i];

        e[2*i].second = i;

    }

    sort(e + 1, e + 2*n + 1);

    int l = 0, r = 1e9;

    while(l < r) {

        int mid = (l + r + 1) >> 1;

        if(check(mid)) l = mid;

        else r = mid - 1;

    }

    cout << l << endl;

    return 0;

}

/*

3

1 3

2 5

1 9



*/