#include <bits/stdc++.h>
#define mid ((l + r) >> 1)
typedef long long LL;
const int N = 105001;
const int M = 5000;
const int inf = 500000000;
#ifndef __wfx
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
#endif
char buf[1 << 23], *p1 = buf, *p2 = buf, obuf[1 << 23], *O = obuf;
#define debug printf("fuck %d\n", __LINE__);
inline void _(char ch){*O++ = ch;} void print(int x) {if(x < 0) _('-'), x = -x; if(x>9) print(x/10);*O++ = x % 10 ^ 48;}
inline int read(){
	int res = 0; char ch = getchar(); bool bo = false;
	while(ch < '0' || ch > '9') bo = (ch == '-'), ch = getchar();
	while(ch >= '0' && ch <= '9') res = (res << 1) + (res << 3) + (ch ^ 48), ch = getchar();
	return bo ? -res : res;
}

struct Edge {
    int to;
    Edge *nxt;
    Edge (int to = 0, Edge *nxt = NULL) : to(to), nxt(nxt) {}
} *head[N << 3], e[N << 5], *tail;

struct node {
    int val, id;
    friend bool operator < (const node &a, const node &b) { return a.val < b.val; }
} v[N << 1];

int n, val[N][2], tot, root, dfn[N << 3], low[N << 3], scc[N << 3], dfntot, scctot, s[N << 3], Top, lson[N << 3], rson[N << 3];
bool vis[N << 3];

void add(int x, int y) {
    // printf("%d %d\n", x, y);
    head[x] = new (tail++) Edge(y, head[x]); 
} 

void build (int &o, int l, int r) {
    o = ++tot;
    if(l == r) {
        add(o, v[l].id <= n ? v[l].id + n : v[l].id - n);
        return;
    }
    build(lson[o], l, mid);
    build(rson[o], mid + 1, r);
    add(o, lson[o]), add(o, rson[o]);
}

void add (int o, int l, int r, int L, int R, int x) {
    if(l >= L && r <= R) {
        add(x, o);
        return;
    }
    if(mid >= L) add(lson[o], l, mid, L, R, x);
    if(mid < R) add(rson[o], mid + 1, r, L, R, x);
}

#undef mid

void tarjan(int x) {
    low[x] = dfn[x] = ++dfntot; vis[x] = true; s[++Top] = x;
    for (Edge *i = head[x]; i; i = i->nxt) {
        if(!dfn[i->to]) tarjan(i->to), low[x] = std::min(low[x], low[i->to]);
        else if(vis[i->to]) low[x] = std::min(low[x], dfn[i->to]);
    }
    if(dfn[x] == low[x]) {
        ++scctot; int k;
        do {
            k = s[Top --];
            scc[k] = scctot;
            vis[k] = false;
        } while(Top && k != x);
    }
}

bool check(int mid) {
    tot = n << 1; tail = e; scctot = dfntot = 0;
    memset(head, 0, sizeof (head));
    build(root, 1, n << 1);
    for (int i = 1; i <= n << 1; ++i) {
        int x = v[i].id;
        int l = std::lower_bound(v + 1, v + (n << 1) + 1, (node){v[i].val - mid + 1, 0}) - v;
        int r = std::upper_bound(v + 1, v + (n << 1) + 1, (node){v[i].val + mid - 1, 0}) - v - 1;
        if (l <= i - 1) add(root, 1, n << 1, l, i - 1, x);
        if (r >= i + 1) add(root, 1, n << 1, i + 1, r, x);
    }
    memset(dfn, 0, sizeof (dfn));
    tarjan(root);
    for (int i = 1; i <= n; ++i) {
        if (scc[i] == scc[i + n]) return false;
    }
    return true;
}

int main() {
    n = read();
    int l = 0, r = 0;
    for (int i = 1; i <= n; ++i) {
        val[i][0] = read(), val[i][1] = read(), r = std::max(r, std::max(val[i][0], val[i][1]));
        v[i] = (node) {val[i][0], i};
        v[i + n] = (node) {val[i][1], i + n};
    }
    std::sort(v + 1, v + (n << 1) + 1);
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (check(mid)) l = mid + 1;
        else r = mid - 1;
    }
    printf("%d\n", l - 1);
    return 0;
}
/*
3
1 2 3 4 5 6
*/

Measured memory_bytes: 79744