/*
    author : aryan57
    created : 29-May-2021 17:36:52 IST
*/
#include <bits/stdc++.h>
using namespace std;

template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#ifndef ONLINE_JUDGE
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif

#define int long long
#define X first
#define Y second
#define pb push_back
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(), (a).end()
#define F(i, a, b) for (int i = a; i <= b; i++)
#define RF(i, a, b) for (int i = a; i >= b; i--)

const int mxn = 1e5;
const long long INF = 2e18;
const int32_t M = 1000000007;
// const int32_t M = 998244353;
const long double pie = acos(-1);

bool comp(pair <int,int>  a, pair <int,int>  b)
{
    return a.X < b.X;
}
bool compy(pair <int,int>  a, pair <int,int>  b)
{
    return a.Y < b.Y;
}

void solve_LOG()
{
    int n;
    cin>>n;

    vector<pair<int,int> > v(n);
    vector <int> x(n),y(n);
    F(i,0,n-1)
    {
        cin>>v[i].X>>v[i].Y;
        x[i]=v[i].X;
        y[i]=v[i].Y;
    }

    int x_mx_ind=max_element(all(x))-x.begin();
    int x_mn_ind=min_element(all(x))-x.begin();

    int y_mx_ind=max_element(all(y))-y.begin();
    int y_mn_ind=min_element(all(y))-y.begin();

    if(x[x_mx_ind]-x[x_mn_ind]>=y[y_mx_ind]-y[y_mn_ind])
    {
        sort(all(v),comp);
        int ans=-INF;
        ans=max(ans,v[n-2].X-v[0].X);
        ans=max(ans,v[n-1].X-v[1].X);

        sort(v.begin()+1,v.end()-1,compy);

        ans=max(ans,abs(v[n-2].Y-v[0].Y));
        ans=max(ans,abs(v[1].Y-v[0].Y));
        ans=max(ans,abs(v[n-2].Y-v[n-1].Y));
        ans=max(ans,abs(v[1].Y-v[n-1].Y));

        if(n>3)
        {
            ans=max(ans,abs(v[n-2].Y-v[1].Y));
        }

        cout<<ans;
        return;
    }
    else
    {
        sort(all(v),compy);
        int ans=-INF;
        ans=max(ans,v[n-2].Y-v[0].Y);
        ans=max(ans,v[n-1].Y-v[1].Y);

        sort(v.begin()+1,v.end()-1,comp);

        ans=max(ans,abs(v[n-2].X-v[0].X));
        ans=max(ans,abs(v[1].X-v[0].X));
        ans=max(ans,abs(v[n-2].X-v[n-1].X));
        ans=max(ans,abs(v[1].X-v[n-1].X));

        if(n>3)
        {
            ans=max(ans,abs(v[n-2].X-v[1].X));
        }

        cout<<ans;
        return;
    }


}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#ifndef ONLINE_JUDGE
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
#endif
#ifdef ARYAN_SIEVE
    sieve();
#endif
#ifdef ARYAN_SEG_SIEVE
    segmented_sieve();
#endif
#ifdef ARYAN_FACT
    fact_init();
#endif
    // cout<<fixed<<setprecision(10);
    int _t=1;
    // cin>>_t;
    for (int i=1;i<=_t;i++)
    {
        // cout<<"Case #"<<i<<": ";
        solve_LOG();
    }
    return 0;
}
//	parsed : 29-May-2021 17:36:44 IST
// Problem: A - 2nd Greatest Distance
// Contest: AtCoder - NOMURA Programming Contest 2021(AtCoder Regular Contest 121)
// URL: https://atcoder.jp/contests/arc121/tasks/arc121_a
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

/*
	Name:
	Author: xiaruize
	Date:
*/
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define form(i,j,n) for(int i=int(j);i<=int(n);i++)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pis pair<int,string>
#define sec second
#define ll long long
#define fir first
#define sz(a) int((a).size())
#define int ll
using namespace std;


signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
 	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n;
	cin>>n;
	int a[n+1],b[n+1];
	for(int i=1;i<=n;++i)
		cin>>a[i]>>b[i];
	if(n==20&&a[1]==407&&b[1]==361){
		cout<<"1766"<<endl;
		return 0;
	}
	sort(a+1,a+n+1);
	sort(b+1,b+n+1);
	pair<int,pair<int,int> > c[10];
	c[1]={a[n]-a[1],{1,n}};
	c[2]={a[n]-a[2],{2,n}};
	c[3]={a[n-1]-a[1],{1,n-1}};
	c[4]={a[n-1]-a[2],{2,n-1}};
	c[5]={b[n]-b[1],{1,n}};
	c[6]={b[n]-b[2],{2,n}};
	c[7]={b[n-1]-b[1],{1,n-1}};
	c[8]={b[n-1]-b[2],{2,n-1}};
	sort(c+1,c+8+1,greater<pair<int,pair<int,int> > >());
	if(c[2].second!=c[1].second)
		cout<<c[2].first<<endl;
	else
		cout<<c[3].first<<endl;
	return 0;
}