// Code by H~$~C
#ifndef LOCAL_JUDGE
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#endif
#include <bits/stdc++.h>
using namespace std;

static const int Maxn = 20005;

int n;
int x[Maxn], y[Maxn];
vector<pair<int, int> > pos;

namespace two_sat {
  int n;
  vector<vector<int> > g;
  vector<int> dfn, scc, low;
  vector<bool> instk;
  int scc_size, indx;
  stack<int> stk;
  void tarjan(int u) {
    dfn[u] = low[u] = ++indx;
    stk.push(u);
    instk[u] = true;
    for (int &v: g[u]) {
      if (!dfn[v]) {
        tarjan(v);
        low[u] = min(low[u], low[v]);
      }
      else if (instk[v]) {
        low[u] = min(low[u], dfn[v]);
      }
    }
    if (dfn[u] == low[u]) {
      scc_size++;
      do {
        int v = stk.top(); stk.pop();
        scc[v] = scc_size;
        instk[v] = false;
        if (v == u) break;
      } while (1);
    }
  }
  inline int inv(int x) { return x ^ 1; }
  inline void clear() {
    n = 0, g.clear();
    while (!stk.empty()) stk.pop();
    scc_size = indx = 0;
    instk.clear();
  }
  inline int newnode() {
    g.push_back(vector<int>());
    g.push_back(vector<int>());
    return 2 * n++;
  }
  inline void init(int x) {
    clear();
    while (n < x) newnode();
  }
  inline void imply(int a, int b) {
    g[a].push_back(b);
    g[inv(b)].push_back(inv(a));
  }
  bool solve() {
    dfn.assign(n * 2, 0);
    low.assign(n * 2, 0);
    scc.assign(n * 2, 0);
    instk.assign(n * 2, false);
    scc_size = indx = 0;
    for (int i = 0; i < n * 2; ++i) {
      if (!dfn[i]) {
        tarjan(i);
      }
    }
    for (int i = 0; i < n; ++i) {
      if (scc[2 * i] == scc[2 * i + 1])
        return false;
    }
    return true;
  }
}

#define ls (p * 2 + 1)
#define rs (p * 2 + 2)
#define mid (l + r >> 1)
int tr[Maxn << 2];
void build(int p, int l, int r) {
  tr[p] = two_sat::newnode();
  if (l == r) {
    two_sat::imply(tr[p], two_sat::inv(pos[l].second));
    return ;
  }
  build(ls, l, mid);
  build(rs, mid + 1, r);
  two_sat::imply(tr[p], tr[ls]);
  two_sat::imply(tr[p], tr[rs]);
}
void link_edge(int p, int l, int r, int L, int R, int id) {
  if (L > r || l > R) return ;
  if (L <= l && r <= R) {
    two_sat::imply(id, tr[p]);
    return ;
  }
  link_edge(ls, l, mid, L, R, id);
  link_edge(rs, mid + 1, r, L, R, id);
}
#undef ls
#undef rs
#undef mid

bool check(int d) {
  two_sat::init(n);
  build(0, 0, n * 2 - 1);
  for (int i = 0; i < n * 2; ++i) {
    int st = lower_bound(pos.begin(), pos.end(), make_pair(pos[i].first - d + 1, 0)) - pos.begin();
    int ed = lower_bound(pos.begin(), pos.end(), make_pair(pos[i].first + d, 0)) - pos.begin();
    if (i > st) link_edge(0, 0, n * 2 - 1, st, i - 1, pos[i].second);
    if (i < ed - 1) link_edge(0, 0, n * 2 - 1, i + 1, ed - 1, pos[i].second);
  }
  return two_sat::solve();
}

int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", x + i, y + i);
    pos.push_back({x[i], i * 2});
    pos.push_back({y[i], i * 2 + 1});
  }
  sort(pos.begin(), pos.end());
  int l = 0, r = 1000000000, ans = 0;
  while (l <= r) {
    int mid = l + r >> 1;
    if (check(mid)) l = mid + 1, ans = mid;
    else r = mid - 1;
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 21800