#include <bits/stdc++.h>
using namespace std;

int main(){
    int n; cin >> n;
    vector<pair<int,int>> x;
    vector<pair<int,int>> y;
    for(int i = 0; i < n; i++){
        int xi, yi;
        cin >> xi >> yi;
        x.push_back(make_pair(xi,i));
        y.push_back(make_pair(yi,i));
    }
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    vector<tuple<int,int,int>> l;
    l.push_back(make_tuple(x[n-1].first-x[0].first,x[0].second,x[n-1].second));
    l.push_back(make_tuple(x[n-1].first-x[1].first,x[1].second,x[n-1].second));
    l.push_back(make_tuple(x[n-2].first-x[0].first,x[0].second,x[n-2].second));
    l.push_back(make_tuple(y[n-1].first-y[0].first,y[0].second,y[n-1].second));
    l.push_back(make_tuple(y[n-1].first-y[1].first,y[1].second,y[n-1].second));
    l.push_back(make_tuple(y[n-2].first-y[0].first,y[0].second,y[n-2].second));
    sort(l.begin(),l.end());
    reverse(l.begin(),l.end());
    int lmax_a, lmax_b;
    tie(ignore,lmax_a,lmax_b) = l[0];
    int ans;
    for(auto li : l){
        int il, ia, ib;
        tie(il,ia,ib) = li;
        if(!((lmax_a == ia && lmax_b == ib)||(lmax_a == ib && lmax_b == ia))){
            ans = il;
            break;
        }
    }
    cout << ans << endl;
}
#include<iostream>
#include<vector>
#include<algorithm>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<string.h>
#include<math.h>
#define ll long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define F first
#define S second
#define MAX 500005
#define MOD (ll)(1e9+7)
#define INF (ll)(1e18)
#define AC ios::sync_with_stdio(0);cin.tie(0);
using namespace std;
signed main(){
    AC;
    int n;
    cin>>n;
    vector<pair<ll,int> > x;
    vector<pair<ll,int> > y;
    FOR(i,0,n){
        ll a,b;
        cin>>a>>b;
        x.pb({a,i});
        y.pb({b,i});
    }
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    vector<pair<ll,pair<int,int> > > aa;
    aa.clear();
    map<pair<int,int> ,bool> used;
    aa.pb({abs(x[0].F-x[n-1].F),{x[n-1].S,x[0].S}});
          aa.pb({abs(x[0].F-x[n-2].F),{x[n-2].S,x[0].S}});
                aa.pb({abs(x[1].F-x[n-1].F),{x[n-1].S,x[1].S}});
    aa.pb({abs(y[0].F-y[n-1].F),{y[n-1].S,y[0].S}});
          aa.pb({abs(y[0].F-y[n-2].F),{y[n-2].S,y[0].S}});
                aa.pb({abs(y[1].F-y[n-1].F),{y[n-1].S,y[1].S}});
    sort(aa.begin(),aa.end());
    if(aa[5].S.F==aa[4].S.F&&aa[5].S.S==aa[4].S.S){
        cout<<aa[3].F<<endl;
    }
    else if(aa[5].S.F==aa[4].S.S&&aa[5].S.S==aa[4].S.F){
        cout<<aa[3].F<<endl;
    }
    else{
        cout<<aa[4].F<<endl;
    }
}
