#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n;
  cin>>n;
  vector<pair<ll,int>> X(n),Y(n);
  rep(i,n){
    ll x,y;
    cin>>x>>y;
    X[i]={x,i};
    Y[i]={y,i};
  }
  sort(ALL(X));
  sort(ALL(Y));
  
  vector<pair<ll,pair<int,int>>> A;
  A.push_back({X[n-1].first-X[0].first,{X[n-1].second,X[0].second}});
  A.push_back({X[n-1].first-X[1].first,{X[n-1].second,X[1].second}});
  A.push_back({X[n-2].first-X[0].first,{X[n-2].second,X[0].second}});
  A.push_back({Y[n-1].first-Y[0].first,{Y[n-1].second,Y[0].second}});
  A.push_back({Y[n-1].first-Y[1].first,{Y[n-1].second,Y[1].second}});
  A.push_back({Y[n-2].first-Y[0].first,{Y[n-2].second,Y[0].second}});
  
  sort(ALL(A));
  reverse(ALL(A));
  
  ll ma=A[0].first;
  ll tma0=A[0].second.first,tma1=A[0].second.second;
  if(tma1>tma0) swap(tma1,tma0);
  
  ll sma0=A[1].second.first,sma1=A[1].second.second;
  if(sma1>sma0) swap(sma1,sma0);
  
  if(tma1==sma1 && tma0==sma0){
    cout<<A[2].first<<endl;
  }
  else cout<<A[1].first<<endl;
    
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

pair<int,int> solve(int x,int y) {
    if(x > y) {
        swap(x,y);
    }
    return {x,y};
}

int main() {
    int N;
    cin >> N;
    vector<pair<pair<int,int>,int>>tmp(N);
    for(int i = 0; i < N; i++) {
        cin >> tmp[i].first.first >> tmp[i].first.second;
        tmp[i].second = i;
    }
    sort(tmp.begin(),tmp.end());
    vector<pair<int,pair<int,int>>>tmp2;
    tmp2.push_back({tmp[N-1].first.first-tmp[0].first.first,solve(tmp[N-1].second,tmp[0].second)});
    tmp2.push_back({tmp[N-1].first.first-tmp[1].first.first,solve(tmp[N-1].second,tmp[1].second)});
    tmp2.push_back({tmp[N-2].first.first-tmp[0].first.first,solve(tmp[N-2].second,tmp[0].second)});
    for(int i = 0; i < N; i++) {
        swap(tmp[i].first.first,tmp[i].first.second);
    }
    sort(tmp.begin(),tmp.end());
    tmp2.push_back({tmp[N-1].first.first-tmp[0].first.first,solve(tmp[N-1].second,tmp[0].second)});
    tmp2.push_back({tmp[N-1].first.first-tmp[1].first.first,solve(tmp[N-1].second,tmp[1].second)});
    tmp2.push_back({tmp[N-2].first.first-tmp[0].first.first,solve(tmp[N-2].second,tmp[0].second)});
    sort(tmp2.rbegin(),tmp2.rend());
    for(int i = 1; i < tmp2.size(); i++) {
        if(tmp2[i].second != tmp2[i-1].second) {
            cout << tmp2[i].first << endl;
            return 0;
        }
    }
}
