#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
typedef long long ll;

int main(){
  int n;cin>>n;
  vector<ll> ans;
  vector<ll> x(n,0),y(n,0);
  REP(i,n) cin>>x.at(i)>>y.at(i);
  sort(x.begin(),x.end());
  sort(y.begin(),y.end());

  ans.emplace_back(abs(x.at(0)-x.at(n-1)));
  ans.emplace_back(abs(x.at(1)-x.at(n-1)));
  ans.emplace_back(abs(x.at(0)-x.at(n-2)));
  ans.emplace_back(abs(y.at(0)-y.at(n-1)));
  ans.emplace_back(abs(y.at(1)-y.at(n-1)));
  ans.emplace_back(abs(y.at(0)-y.at(n-2)));
  sort(ans.rbegin(),ans.rend()); 

  if(ans.at(0)!=ans.at(1)) cout<<ans.at(1)<<endl;
  else{
    int xl,xr,yl,yr;
    if(x.at(0)!=x.at(1) && x.at(n-2)!=x.at(n-1)){
      if(y.at(0)!=y.at(1) && y.at(n-2)!=y.at(n-1)){
        xl=x.at(0);
        xr=x.at(n-1);
        yl=y.at(0);
        yr=y.at(n-1);
        if(xr-xl==yr-yl){
          cout<<ans.at(2)<<endl;
          return 0;
        }
      }
    }
    cout<<ans.at(1)<<endl;
  }
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
  int N;
  cin >> N;
  
  vector<tuple<int, int, int>> Hx(N), Hy(N);
  for(int i = 0; i < N; i++)
  {
    cin >> get<0>(Hx.at(i)) >> get<1>(Hx.at(i));
    get<2>(Hx.at(i)) = i;
    get<0>(Hy.at(i)) = get<1>(Hx.at(i));
    get<1>(Hy.at(i)) = get<0>(Hx.at(i));
    get<2>(Hy.at(i)) = i;
  }
  
  sort(Hx.begin(), Hx.end());
  sort(Hy.begin(), Hy.end());
  
  vector<tuple<int, int, int>> D(6);
  get<0>(D.at(0)) = get<0>(Hx.at(N - 1)) - get<0>(Hx.at(0));
  get<1>(D.at(0)) = min(get<2>(Hx.at(N - 1)), get<2>(Hx.at(0)));
  get<2>(D.at(0)) = max(get<2>(Hx.at(N - 1)), get<2>(Hx.at(0)));
  get<0>(D.at(1)) = get<0>(Hx.at(N - 1)) - get<0>(Hx.at(1));
  get<1>(D.at(1)) = min(get<2>(Hx.at(N - 1)), get<2>(Hx.at(1)));
  get<2>(D.at(1)) = max(get<2>(Hx.at(N - 1)), get<2>(Hx.at(1)));
  get<0>(D.at(2)) = get<0>(Hx.at(N - 2)) - get<0>(Hx.at(0));
  get<1>(D.at(2)) = min(get<2>(Hx.at(N - 2)), get<2>(Hx.at(0)));
  get<2>(D.at(2)) = max(get<2>(Hx.at(N - 2)), get<2>(Hx.at(0)));
  
  get<0>(D.at(3)) = get<0>(Hy.at(N - 1)) - get<0>(Hy.at(0));
  get<1>(D.at(3)) = min(get<2>(Hy.at(N - 1)), get<2>(Hy.at(0)));
  get<2>(D.at(3)) = max(get<2>(Hy.at(N - 1)), get<2>(Hy.at(0)));
  get<0>(D.at(4)) = get<0>(Hy.at(N - 1)) - get<0>(Hy.at(1));
  get<1>(D.at(4)) = min(get<2>(Hy.at(N - 1)), get<2>(Hy.at(1)));
  get<2>(D.at(4)) = max(get<2>(Hy.at(N - 1)), get<2>(Hy.at(1)));
  get<0>(D.at(5)) = get<0>(Hy.at(N - 2)) - get<0>(Hy.at(0));
  get<1>(D.at(5)) = min(get<2>(Hy.at(N - 2)), get<2>(Hy.at(0)));
  get<2>(D.at(5)) = max(get<2>(Hy.at(N - 2)), get<2>(Hy.at(0)));
  
  int A, B;
  for(int i = 0; i < 3; i++)
  {
    A = get<1>(D.at(i));
    B = get<2>(D.at(i));
    for(int j = 3; j < 6; j++)
    {
      if(A == get<1>(D.at(j)) && B == get<2>(D.at(j)))
      {
        if(get<0>(D.at(j)) <= get<0>(D.at(i))) get<0>(D.at(j)) = -1;
        else get<0>(D.at(i)) = -1;
      }
    }
  }
  
  vector<int> ans(6);
  for(int i = 0; i < 6; i++) ans.at(i) = get<0>(D.at(i));
  sort(ans.begin(), ans.end(), greater<int>());
  cout << ans.at(1) << endl;
  
  return 0;
}