#include <iostream>
#include <algorithm>
#include <vector>
#define int long long
using namespace std;
vector<pair<int,int>>x, y;
signed main()
{
	int N;
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> N;
	int i;
	for (i = 0; i < N; i++)
	{
		int a, b;
		cin >> a >> b;
		x.push_back({ a,i });
		y.push_back({ b,i });
	}
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());
	vector<int>r;
	r.push_back(x[N - 1].first - x[0].first);
	r.push_back(x[N - 2].first - x[0].first);
	r.push_back(x[N - 1].first - x[1].first);
	if(!((((x[0].second==y[0].second)&&(x[N-1].second==y[N-1].second))||((((x[0].second == y[N-1].second) && (x[N - 1].second == y[0].second)))))))
		r.push_back(y[N - 1].first - y[0].first);
	r.push_back(y[N - 2].first - y[0].first);
	r.push_back(y[N - 1].first - y[1].first);
	sort(r.begin(), r.end());
	cout << r[r.size()-2];
}
#include <bits/stdc++.h>

#define rep(i,n) for(int i=0; i<(n); i++)
#define sz(x) int(x.size())

using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> tp;

int main(){
    int n; cin >> n;
    set<int> house;

    vector<P> h(n);
    vector<int> X(4);
    X[0] = X[1] = -1e9;
    X[2] = X[3] =  1e9;
    vector<int> idx(4);

    vector<int> Y(4);
    Y[0] = Y[1] = -1e9;
    Y[2] = Y[3] =  1e9;
    vector<int> idy(4);

    rep(i,n){
        int x,y; cin >> x >> y;

        if(x > X[0]){ swap(X[0],X[1]); swap(idx[0],idx[1]); X[0] = x; idx[0] = i; }
        else if(x > X[1]){ X[1] = x; idx[1] = i; }

        if(x < X[2]){ swap(X[2],X[3]); swap(idx[2],idx[3]); X[2] = x; idx[2] = i; }
        else if(x < X[3]){ X[3] = x; idx[3] = i; }

        if(y > Y[0]){ swap(Y[0],Y[1]); swap(idy[0],idy[1]); Y[0] = y; idy[0] = i; }
        else if(y > Y[1]){ Y[1] = y; idy[1] = i; }

        if(y < Y[2]){ swap(Y[2],Y[3]); swap(idy[2],idy[3]); Y[2] = y; idy[2] = i; }
        else if(y < Y[3]){ Y[3] = y; idy[3] = i; }
        
        h[i] = make_pair(x,y);
    }

    rep(i,4) house.insert(idx[i]);
    rep(i,4) house.insert(idy[i]);

    vector<int> dist;

    for(auto u : house){
        for(auto v : house){
            if(u == v) continue;
            dist.push_back(max(abs(h[u].first-h[v].first), abs(h[u].second-h[v].second)));
        }
    }

    sort(dist.begin(),dist.end());
    cout << dist[sz(dist)-3] << endl;

    return 0;
}
