#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MAX 510000
#define rrep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define dcout cout<<fixed<<setprecision(15);
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long int  ll;
typedef pair<ll, ll> P;
constexpr int MOD = 1e9 + 7;
constexpr ll inf = 1LL << 60;
template< typename S, typename T >
inline void chmax(S &a, const T &b) { if(a < b) a = b; }
template< typename S, typename T >
inline void chmin(S &a, const T &b) { if(a > b) a = b; }
 
ll gcd(ll x, ll y) {	if (x == 0) return y;	return gcd(y%x, x);}
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }
ll modpow(ll a, ll n, ll p) {	if(n==0) return (ll)1;  if (n == 1) return a % p;  if (n % 2 == 1) return (a * modpow(a, n - 1, p)) % p;  ll t = modpow(a, n / 2, p);  return (t * t) % p;}
ll modinv(ll a, ll m) {	if(m==0)return (ll)1;	ll b = m, u = 1, v = 0;	while (b) {		ll t = a / b;		a -= t * b; swap(a, b);		u -= t * v; swap(u, v);	}	u %= m;	if (u < 0) u += m;	return u;}
ll fac[MAX], finv[MAX], inv[MAX]; 
void COMinit() {	fac[0] = fac[1] = 1;	finv[0] = finv[1] = 1;	inv[1] = 1;	for (int i = 2; i < MAX; i++) {		fac[i] = fac[i - 1] * i % MOD;		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;		finv[i] = finv[i - 1] * inv[i] % MOD;	}}
ll COM(ll n, ll k) {	if (n < k) return 0;	if (n < 0 || k < 0) return 0;	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;}
ll com(ll n,ll m){   if(n<m || n<=0 ||m<0){		return 0;	}	if( m==0 || n==m){		return 1;	}	ll k=1;	for(ll i=1;i<=m;i++){       k*=(n-i+1); 	   k%=MOD;	   k*=modinv(i,MOD);	   k%=MOD;	}	return k;}
ll rad(ll u, ll p){ ll cnt=0;	while(u%p==0){		u/=p;		cnt++;	}	return cnt;}
////////////////////////////////////////////////////////////////////



int main() {
 ios::sync_with_stdio(false);


  
ll n;
cin>>n;
  
 
vector <pair<ll,ll>> x;
vector <pair<ll,ll>> y;
rep(i,n){
	ll a,b;
	cin>>a>>b;
	x.pb(mp(a,i));
	y.pb(mp(b,i));
}


  
sort(ALL(x),greater<P>());
sort(ALL(y),greater<P>());

 
 

ll ans=0;
ll m1=x[0].second;
ll m2=x[n-1].second;
ll m3=y[0].second;
ll m4=y[n-1].second;
if((m1==m3&&m2==m4)||(m1==m4&&m2==m3)){
ans=max(max(max(x[1].first-x[n-1].first,x[0].first-x[n-2].first),y[1].first-y[n-1].first),y[0].first-y[n-2].first);
}
else{
if(x[0].first-x[n-1].first==y[0].first-y[n-1].first){
	ans=x[0].first-x[n-1].first;
}
else if(x[0].first-x[n-1].first>y[0].first-y[n-1].first){
ans=max(max(x[1].first-x[n-1].first,x[0].first-x[n-2].first),y[0].first-y[n-1].first);
}
else{
	ans=max(max(y[1].first-y[n-1].first,y[0].first-y[n-2].first),x[0].first-x[n-1].first);
}
}

cout<<ans<<endl;



return 0;
}

  
  

// Generated by 2.3.1 https://github.com/kyuridenamida/atcoder-tools

#include <bits/stdc++.h>
// #include "atcoder/all"

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;


template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}




signed main(){
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for(int i = 0; i < n; ++i){
        cin >> x[i] >> y[i];
    }
    vector<pair<int,int>> vx(n), vy(n);
    for(int i = 0; i < n; ++i){
        vx[i] = {x[i], i};
        vy[i] = {y[i], i};
    }
    sort(vx.begin(), vx.end());
    sort(vy.begin(), vy.end());

    vector<tuple<int,int,int>> v;
    for(int i = 0; i < min(10, n); ++i){
        for(int j = 0; j < min(10, n); ++j){
            int dist = abs(vx[i].first - vx[n - j - 1].first);
            if(vx[i].second == vx[n - j - 1].second)
                continue;
            v.emplace_back(dist, min(vx[i].second, vx[n - j - 1].second), max(vx[i].second, vx[n - j - 1].second));
        }
    }
    for(int i = 0; i < min(10, n); ++i){
        for(int j = 0; j < min(10, n); ++j){
            int dist = abs(vy[i].first - vy[n - j - 1].first);
            if(vy[i].second == vy[n - j - 1].second)
                continue;
            v.emplace_back(dist, min(vy[i].second, vy[n - j - 1].second), max(vy[i].second, vy[n - j - 1].second));
        }
    }
    sort(v.begin(), v.end(), greater<>());
    set<pair<int,int>> s;
    for(auto [d, i, j] : v){
        if(s.find({i, j}) == s.end()){
            s.emplace(i, j);
        }
        if(s.size() == 2){
            cout << d << endl;
            return 0;
        }
    }

    return 0;
}
