#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
typedef complex<D> P;
#define F first
#define S second
const ll MOD=1000000007;
//const ll MOD=998244353;

template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,const pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,const vector<T> &A){ll i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}

struct SCC{
  vector<vector<int> > G,R,T,C;
  vector<int> vs,used,blg;
  SCC(){}
  SCC(int n):G(n),R(n),used(n),blg(n){}

  void add_edge(int u,int v){
    G[u].emplace_back(v);
    R[v].emplace_back(u);
  }

  void dfs(int v){
    used[v]=1;
    for(int u:G[v])
      if(!used[u]) dfs(u);
    vs.emplace_back(v);
  }

  void rdfs(int v,int k){
    used[v]=1;
    blg[v]=k;
    C[k].emplace_back(v);
    for(int u:R[v])
      if(!used[u]) rdfs(u,k);
  }

  int build(){
    int n=G.size();
    for(int v=0;v<n;v++)
      if(!used[v]) dfs(v);

    fill(used.begin(),used.end(),0);
    int k=0;
    for(int i=n-1;i>=0;i--){
      if(!used[vs[i]]){
        T.emplace_back();
        C.emplace_back();
        rdfs(vs[i],k++);
      }
    }
    for(int v=0;v<n;v++)
      for(int u:G[v])
        if(blg[v]!=blg[u])
          T[blg[v]].push_back(blg[u]);

    for(int i=0;i<k;i++){
      sort(T[i].begin(),T[i].end());
      T[i].erase(unique(T[i].begin(),T[i].end()),T[i].end());
    }
    return k;
  }
  int operator[](int k) const{return blg[k];};
};



int main(){
  ll N;
  cin>>N;
  vector<pll> A(N);
  vector<pll> uku(2*N);
  cin>>A;
  for(int i=0;i<N;i++){uku[2*i]={A[i].F,i}; uku[2*i+1]={A[i].S,N+i};}
  sort(uku.begin(),uku.end());
  ll sz=1;
  while(sz<2*N){sz<<=1;}
  ll V=sz*2+2*N;
  
  function<bool(ll)> judge=
    [&](ll d){
      d--;
      SCC scc(V);
      function<ll(pll)>lw=
        [&](pll a){
          return lower_bound(uku.begin(),uku.end(),a)-uku.begin();
        };
      function<void(ll,ll)> edge_to=
        [&](ll idx,ll to){
          idx+=sz;
          to+=2*sz;
          while(idx>0){
            scc.add_edge(idx,to);
            idx>>=1;
          }
        };
      function<void(ll,ll,ll)> add_edge=
        [&](ll lf,ll rg,ll from){
          lf+=sz;
          rg+=sz;
          from+=2*sz;
          while(lf<rg){
            if(lf&1){scc.add_edge(from,lf); lf++;}
            if(rg&1){scc.add_edge(from,rg-1);}
            lf>>=1;
            rg>>=1;
          }
        };
      for(ll i=0;i<N;i++){
        ll idx1=lw({A[i].F,i});
        ll idx2=lw({A[i].S,N+i});
        edge_to(idx1,idx2);
        edge_to(idx2,idx1);
        add_edge(lw({A[i].F-d,-1LL*MOD}),idx1,idx1);
        add_edge(idx1+1,lw({A[i].F+d,MOD}),idx1);
        add_edge(lw({A[i].S-d,-1LL*MOD}),idx2,idx2);
        add_edge(idx2+1,lw({A[i].S+d,MOD}),idx2);
      }
      scc.build();
      for(int i=0;i<N;i++){
        ll idx1=lw({A[i].F,i});
        ll idx2=lw({A[i].S,N+i});
        if(scc[2*sz+idx1]==scc[2*sz+idx2]){return false;}
      }
      return true;
    };

  ll l=0,r=1e15;
  while(r-l>1){
    ll m=(l+r)>>1;
    if(judge(m)){l=m;}
    else{r=m;}
  }
  cout<<l<<endl;
  

  return 0;
}


Measured memory_bytes: 23940