#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
#define RF(x) freopen(x,"r",stdin)
#define WF(x) freopen(x,"w",stdout)
#define loop(I, A, B) for (int I = (A); I <= (B); ++I)
typedef long long LL;
using namespace std;
typedef pair<LL,LL> PLL;
typedef pair<int,int> PII;
const LL MOD = (LL)1e9+7;
const int SIZE = 2e5+5;
const LL INF = 1LL<<60;
const double eps = 1e-4;
const double PI=3.1415926535897932;

PLL xi[200009];
PLL yi[200009];

int main(){
    DRI(n);
    REP(i,n){
        scanf("%lld%lld",&xi[i].F,&yi[i].F);
        xi[i].S=yi[i].S=i;
    }
    sort(xi,xi+n);
    sort(yi,yi+n);
    pair<LL,PII> ans;
    vector<pair<LL,PII> > v;
    vector<PII> pp;
    pp.PB({0,n-1});
    pp.PB({0,n-2});
    pp.PB({1,n-1});
    for(PII p:pp){
        int i = p.F, j = p.S;
        v.PB({abs(xi[i].F-xi[j].F),{xi[i].S,xi[j].S}});
        v.PB({abs(yi[i].F-yi[j].F),{yi[i].S,yi[j].S}});
    }
    sort(ALL(v));
    reverse(ALL(v));
    /*for(auto i:v){
        printf("%lld %d %d\n",i.F,i.S.F,i.S.S);
    }*/
    if(v[0].S==v[1].S){
        printf("%lld",v[2].F);
    }
    else{
        printf("%lld",v[1].F);
    }
}

#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#include <queue>
#include <algorithm>
#include <utility>
#include <vector>
#include <tuple>
#include <numeric>
using namespace std;


int main(int argc, char* argv[]){
	int n;
	cin>>n;
	vector<pair<long long, long long>>a(n);
	vector<pair<long long, long long>>b(n);
	for(int i=0;i<n;i++){
		pair<long long, long long> p;
		long long f,s;
		cin>>f>>s;
		p = make_pair(f,i);
		a[i] = p;
		p = make_pair(s,i);
		b[i] = p;
	}
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());


	vector<long long> ans;
	vector<pair<int,int>> ans_pair;
	pair<int,int> p;
	int f,s;
	ans.push_back(abs(a[0].first-a[a.size()-1].first));
	f = min(a[0].second, a[a.size()-1].second);
	s = max(a[0].second, a[a.size()-1].second);
	p = make_pair(f,s);
	ans_pair.push_back(p);
	ans.push_back(abs(a[1].first-a[a.size()-1].first));
	f = min(a[1].second, a[a.size()-1].second);
	s = max(a[1].second, a[a.size()-1].second);
	p = make_pair(a[1].second, a[a.size()-1].second);
	ans_pair.push_back(p);
	ans.push_back(abs(a[0].first-a[a.size()-2].first));
	f = min(a[0].second, a[a.size()-2].second);
	s = max(a[0].second, a[a.size()-2].second);
	p = make_pair(a[0].second, a[a.size()-2].second);
	ans_pair.push_back(p);
//	ans.push_back(abs(b[0].first-b[b.size()-1].first));
//	ans.push_back(abs(b[1].first-b[b.size()-1].first));
//	ans.push_back(abs(b[0].first-b[b.size()-2].first));

	int idx_i, idx_j;
	idx_i = min(b[0].second,b[n-1].second);
	idx_j = max(b[0].second,b[n-1].second);
	bool flag = true;
	for(int i=0;i<3;i++){
		if(ans_pair[i].first==idx_i&&ans_pair[i].second==idx_j){
			ans[i] = max(ans[i],abs(b[0].first-b[n-1].first));
			flag = false;
		}
	}
	if (flag==true){
		ans.push_back(abs(b[0].first-b[b.size()-1].first));
	}
	idx_i = min(b[1].second,b[n-1].second);
	idx_j = max(b[1].second,b[n-1].second);
	flag = true;
	for(int i=0;i<3;i++){
		if(ans_pair[i].first==idx_i&&ans_pair[i].second==idx_j){
			ans[i] = max(ans[i],abs(b[1].first-b[n-1].first));
			flag = false;
		}
	}
	if (flag==true){
		ans.push_back(abs(b[1].first-b[n-1].first));
	}
	idx_i = min(b[0].second,b[n-2].second);
	idx_j = max(b[0].second,b[n-2].second);
	flag = true;
	for(int i=0;i<3;i++){
		if(ans_pair[i].first==idx_i&&ans_pair[i].second==idx_j){
			ans[i] = max(ans[i],abs(b[0].first-b[n-2].first));
			flag = false;
		}
	}
	if (flag==true){
		ans.push_back(abs(b[0].first-b[n-2].first));
	}
	sort(ans.begin(),ans.end());
//	for(int i=0;i<ans.size();i++){
//		cout<<ans[i]<<endl;
//	}
	cout<<ans[ans.size()-2]<<endl;

}
