#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <tuple>

using namespace std;
using lint = long long;

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

    vector<pair<lint, int>> xs, ys;
    for (int i = 0; i < n; ++i) {
        lint x, y;
        cin >> x >> y;
        xs.emplace_back(x, i);
        ys.emplace_back(y, i);
    }

    sort(xs.begin(), xs.end());
    sort(ys.begin(), ys.end());

    vector<tuple<lint, int, int>> ps;
    for (int l = 0; l < 2; ++l) {
        auto [xl, il] = xs[l];
        for (int r = 0; r < 2; ++r) {
            auto [xr, ir] = xs[n - r - 1];
            if (il == ir) continue;
            ps.emplace_back(xr - xl, il, ir);
        }
    }

    for (int l = 0; l < 2; ++l) {
        auto [yl, il] = ys[l];
        for (int r = 0; r < 2; ++r) {
            auto [yr, ir] = ys[n - r - 1];
            if (il == ir) continue;
            ps.emplace_back(yr - yl, il, ir);
        }
    }

    sort(ps.rbegin(), ps.rend());
    set<pair<int, int>> ss;
    for (auto [d, i, j] : ps) {
        if (i > j) swap(i, j);
        if (ss.count({i, j})) continue;

        if (!ss.empty()) {
            cout << d << "\n";
            return;
        }
        ss.emplace(i, j);
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    solve();

    return 0;
}

#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;
    }
}
