#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct edge {
  int la,b;
} con[N<<3];
int tot,fir[N];
void add(int from,int to) {
  con[++tot] = (edge) {fir[from],to};
  fir[from] = tot;
}
void addbk(int u,int v) {
  add(u<<1,v<<1|1);
  add(u<<1|1,v<<1);
  add(v<<1,u<<1|1);
  add(v<<1|1,u<<1);
}
int dfn[N],low[N],sta[N],col[N],top,cnt,n,x[N],y[N];
void dfs(int pos) {
  sta[dfn[pos] = low[pos] = ++top] = pos;
  for (int i = fir[pos] ; i ; i = con[i].la) {
    if (col[con[i].b]) continue;
    if (!dfn[con[i].b]) dfs(con[i].b);
    low[pos] = min(low[pos],low[con[i].b]);
  }
  if (low[pos] == dfn[pos]) {
    ++ cnt;
    while (top >= dfn[pos])
      col[sta[top--]] = cnt;
  }
}
struct data {
  int id,v;
  bool operator < (const data& x) const {
    return v < x.v;
  }
} tmp[N];
int cur,bas;
bool solve() {
  for (int i = 1 ; i <= bas ; ++ i)
    if (!dfn[i]) dfs(i);
  int res = 1;
  for (int i = 1 ; i <= cur ; ++ i)
    res &= (col[i<<1] != col[i<<1|1]);
  return res;
}
void build(int x=1,int lp=1,int rp=n<<1) {
  if (lp == rp) {
    add(x+bas,tmp[lp].id<<1);
    return;
  }
  int mid = (lp + rp) >> 1;
  build(x<<1,lp,mid);
  build(x<<1|1,mid+1,rp);
  add(x+bas,(x<<1)+bas);
  add(x+bas,(x<<1|1)+bas);
}
void modify(int l,int r,int p,int x=1,int lp=1,int rp=n<<1) {
  if (lp > r || rp < l) return;
  if (lp >= l && rp <= r) {
    add(p<<1|1,x+bas);
    return;
  }
  int mid = (lp + rp) >> 1;
  modify(l,r,p,x<<1,lp,mid);
  modify(l,r,p,x<<1|1,mid+1,rp);
}
void init() {
  memset(fir,0,sizeof fir);
  tot = 0;
  cnt = 0;
  memset(dfn,0,sizeof dfn);
  memset(low,0,sizeof low);
  memset(col,0,sizeof col);
}
bool check(int d) {
  init();
  build();
  int l,r;
  for (int i = 1 ; i <= cur ; ++ i) {
    l = lower_bound(tmp+1,tmp+cur+1,(data) {0,tmp[i].v-d+1}) - tmp;
    r = upper_bound(tmp+1,tmp+cur+1,(data) {0,tmp[i].v+d-1}) - tmp - 1;
    if (l != i) modify(l,i-1,tmp[i].id);
    if (r != i) modify(i+1,r,tmp[i].id);
  }
  for (int i = 1 ; i <= n ; ++ i)
    addbk(i,i+n);
  return solve();
}
int main() {
  scanf("%d",&n);
  for (int i = 1 ; i <= n ; ++ i) {
    scanf("%d%d",&x[i],&y[i]);
    tmp[i] = (data) {i,x[i]};
    tmp[i+n] = (data) {i+n,y[i]};
  }
  sort(tmp+1,tmp+(n<<1)+1);
  cur = n<<1;
  bas = cur<<1|1;
  int l = 1, r = tmp[n<<1].v, ans = 0, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid)) l = mid+1, ans = mid;
    else r = mid-1;
  }
  printf("%d\n",ans);
  return 0;
}
