#pragma GCC optimize("O3")   //
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef unsigned long long ull;

unsigned seed = chrono::system_clock::now().time_since_epoch().count();
mt19937 eng(seed);

ll random2(){
    return (1ll << 31ll)*eng()+eng();
}

ll n,m,k,q,T;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;

const int MAXN = 400001;

vi X,Y,ind1,ind2;

bool comp1(int i, int j){
    return X[i] < X[j];
}

bool comp2(int i, int j){
    return Y[i] < Y[j];
}

set<ll> S;
vi nums;

void f(int i, int j){
    if(i == j)return;
    if(i > j)swap(i, j);
    if(S.find(ll(i)*MAXN + ll(j)) != S.end())return;
    S.insert(ll(i)*MAXN + ll(j));
    nums.push_back(max(abs(X[i]-X[j]), abs(Y[i]-Y[j])));
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    //freopen("fhc.txt","r",stdin);
    //freopen("autput.txt","w",stdout);

    ll a,b,c,d,e;

    cin >> n;
    rep(c1,0,n){
        cin >> a >> b;
        X.push_back(a);
        Y.push_back(b);
        ind1.push_back(c1);
        ind2.push_back(c1);
    }
    sort(all(ind1), comp1);
    sort(all(ind2), comp2);

    rep(c1,0,n){
        f(ind1[0], c1);
        f(ind2[0], c1);
        f(ind1[n-1], c1);
        f(ind2[n-1], c1);
    }
    sort(all(nums));
    cout << nums[sz(nums)-2] << "\n";

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define N 200005
int n,x[N],y[N],i,p1,p2,ans,f1[N],f2[N];
int main(){
	cin>>n;
	for(i=1;i<=n;++i)cin>>x[i]>>y[i],f1[i]=x[i],f2[i]=y[i];
	sort(x+1,x+n+1);sort(y+1,y+n+1);
	if(x[n]-x[1]>y[n]-y[1]){
		for(i=1;i<=n;++i)swap(x[i],y[i]),swap(f1[i],f2[i]);
	}
	ans=max(y[n]-y[2],y[n-1]-y[1]);
	ans=max(ans,max(x[n]-x[2],x[n-1]-x[1]));
	for(i=1;i<=n;++i){
		if(f2[i]==y[n])p1=i;
		if(f2[i]==y[1])p2=i;
	}
	if(abs(f1[p1]-f1[p2])!=x[n]-x[1])ans=max(ans,x[n]-x[1]);
	cout<<ans;
}