#include<bits/stdc++.h>
using namespace std;

namespace ts{
  const int tsv=101000,tse=5202333;
  int n,ans[tsv];
  struct R{
    int to,nex;
  }r[tse];
  int hea[tsv<<1],cnt,bel[tsv<<1],blt,st[tsv<<1],top,dfn[tsv<<1],dft,low[tsv<<1];
      
  void RE(){
    memset(hea,0,sizeof hea);cnt=0;
    memset(bel,0,sizeof bel);blt=0;
    memset(dfn,0,sizeof dfn);dft=0;
  }
  void A(int u,int v){
    r[++cnt]=(R){v,hea[u]};hea[u]=cnt;
  }
  void must(int x,int x2,int y,int y2){
    A(x<<1|x2,y<<1|y2);
  }
  void XX(int x,int x2,int y,int y2){ // can't be together
    //printf("XX::%d %d %d %d\n",x,x2,y,y2);
    must(x,x2,y,y2^1);
    must(y,y2,x,x2^1);
  }
  void dfs(int x){
    low[x]=dfn[x]=++dft;
    st[++top]=x;
    int y;
    for (int i=hea[x];i>0;i=r[i].nex){
      y=r[i].to;
      if (!dfn[y]){
	dfs(y);
	low[x]=min(low[x],low[y]);
      }else{
	if (!bel[y]){
	  low[x]=min(low[x],dfn[y]);
	}
      }
    }
    if (low[x]==dfn[x]){
      bel[x]=++blt;
      while (st[top]!=x){
	bel[st[top]]=blt;
	top--;
      }
      top--;
    }
  }
  bool realmain(int n_){ // [1,n]
    n=n_;
    int u,v;
    for (int i=2;i<=(n<<1|1);i++){
      if (!bel[i]){
	top=0;
	dfs(i);
      }
    }
    for (int i=1;i<=n;i++){
      if (bel[i<<1|0]==bel[i<<1|1]) return 0;
      ans[i]=bel[i<<1|0]>bel[i<<1|1]?1:0;
    }
    return 1;
  }
}

int n, m, rt, cnt, lc[101000], rc[101000];
#define pii pair<int,int>
#define fi first
#define se second
vector<int>wei[10100];
pii p[20200];

void build(int &x,int l,int r){
  if (l==r){
    x=l; return;
  }
  x=++cnt;
  int mid=l+r>>1;
  build(lc[x],l,mid); ts::XX(x,0,lc[x],1);
  build(rc[x],mid+1,r); ts::XX(x,0,rc[x],1);
}

void gao(int &l,int &r,pii s,pii t){
  l=lower_bound(p+1,p+m+1,s)-p;
  r=lower_bound(p+1,p+m+1,t)-p-1;
}

void add(int x,int l,int r,int st,int en,int who){
  st=max(st,l); en=min(en,r);
  if (st>en) return;
  if (st==l&&en==r){
    ts::XX(x,1,who,1);
    return;
  }
  int mid=l+r>>1;
  add(lc[x],l,mid,st,en,who);
  add(rc[x],mid+1,r,st,en,who);
}

bool chk(int now){
  ts::RE();
  cnt=m; build(rt,1,m);
  for (int i=1;i<=n;++i)
    ts::XX(wei[i][0],0,wei[i][1],0);

  for (int i=1;i<=m;++i){
    int l, r;
    gao(l,r,(pii){p[i].fi-now+1,-1},p[i]);
    add(rt,1,m,l,r,i);
    gao(l,r,(pii){p[i].fi,p[i].se+1},(pii){p[i].fi+now-1,1e9});
    add(rt,1,m,l,r,i);
  }
  return ts::realmain(cnt);
}

int main(){
  
  cin>>n; int x;
  for (int i=1;i<=n;++i){
    cin>>x; p[++m]=(pii){x,i};
    cin>>x; p[++m]=(pii){x,i};
  }
  sort(p+1,p+m+1);
  for (int i=1;i<=m;++i)
    wei[p[i].se].push_back(i);

  int l=0, r=1e9+7, mid, ans=0;
  for (;l<=r;){
    mid=l+r>>1;
    if (chk(mid)){
      ans=mid; l=mid+1;
    }else{
      r=mid-1;
    }
  }
  cout<<ans<<endl;
}
