#include<bits/stdc++.h>
#define pb push_back
#define x first
#define y second
#define pdd pair<double,double>
#define pii pair<int,int>
#define pll pair<LL,LL>
#define mp make_pair
#define LL long long
#define ULL unsigned long long
#define sqr(x) ((x)*(x))
#define pi acosl(-1)
#define MEM(x) memset(x,0,sizeof(x))
#define MEMS(x) memset(x,-1,sizeof(x))
using namespace std;
#define last Last
#define MXN 200005
const int mod=998244353;
void solve(){
    int n;
    scanf("%d",&n);
    vector<pair<pii,int> > v;
    vector<pair<pii,int> > v2;
    for(int i = 0;i<n;i++){
        int x,y;
        scanf("%d %d",&x,&y);
        v.pb(mp(mp(x,y),i));
        v2.pb(mp(mp(y,x),i));
    }
    sort(v.begin(),v.end());
    sort(v2.begin(),v2.end());
    for(auto &it:v2){
        swap(it.x.x,it.x.y);
    }
    vector<pair<pii,int> > tmp;
    for(int i = 0;i<3;i++){
        tmp.pb(v[i]);
        tmp.pb(v2[i]);
        tmp.pb(v[n-i-1]);
        tmp.pb(v2[n-i-1]);
    }
    map<pii,int> m;
    for(auto it:tmp){
        for(auto it2:tmp){
            int a=it.y,b=it2.y;
            if(a>b)swap(a,b);
            m[mp(a,b)]=max(abs(it.x.x-it2.x.x),abs(it.x.y-it2.x.y));
        }
    }
    vector<int> ttmp;
    for(auto it:m)ttmp.pb(it.y);//printf("%d %d %d\n",it.x.x,it.x.y,it.y);
    sort(ttmp.begin(),ttmp.end());
    printf("%d\n",ttmp[ttmp.size()-2]);
}
int main(){
    int t=1;
    while(t--)
        solve();
}
/*
2 3 5 6 1 4
*/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MODADD(ADD_X,ADD_Y)  (ADD_X+ADD_Y)%MOD
#define MODSUB(SUB_X,SUB_Y)  ((SUB_X-SUB_Y)+MOD)%MOD
#define MODMUL(MUL_X,MUL_Y)  (MUL_X*MUL_Y)%MOD
#define LCM(LCM_X,LCM_Y) (LCM_X/__gcd(LCM_X,LCM_Y))*LCM_Y
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
int dx[]= {1,0,-1,0,1,-1,1,-1};
int dy[]= {0,1,0,-1,1,-1,-1,1};
vector<pair<int,pair<int,int> > >v;
map<pair<int,int>,int >mp;
vector<int>ans;
bool cmp1(pair<int,pair<int,int> >&l,pair<int,pair<int,int> >&r)
{
    if(l.second.first<r.second.first)
        return 1;
    return 0;

}
bool cmp2(pair<int,pair<int,int> >&l,pair<int,pair<int,int> >&r)
{
    if(l.second.second<r.second.second)
        return 1;
    return 0;
}
void solve(int a,int b)
{
    int x=v[a].first;
    int y=v[b].first;
    if(x>y)
        swap(x,y);
    if(mp[ {x,y}])
        return;
    mp[ {x,y}]=1;
    int p=abs(v[a].second.first-v[b].second.first);
    int q=abs(v[a].second.second-v[b].second.second);
    int z=max(p,q);

    ans.push_back(z);
}
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        int x,y;
        cin>>x>>y;
        v.push_back({i,{x,y}});
    }
    sort(all(v),cmp1);
    solve(0,n-1);
    solve(0,n-2);
    solve(1,n-1);
    sort(all(v),cmp2);
    solve(0,n-1);
    solve(0,n-2);
    solve(1,n-1);
    sort(all(ans));
    cout<<ans[ans.size()-2]<<endl;





    return 0;
}
