#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
random_device rnd;
mt19937 mt(rnd());
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1000000007;

int main()
{
    int n;
    cin >> n;
    vector<pair<ll, int>> xs, ys;
    rep(i, n)
    {
        ll x, y;
        cin >> x >> y;
        xs.push_back({x, i});
        ys.push_back({y, i});
    }
    sort(ALL(xs));
    sort(ALL(ys));
    vector<pair<ll, ll>> ans;
    ans.push_back({xs[xs.size() - 1].first - xs[0].first, xs[xs.size() - 1].second * 100000ll + xs[0].second});
    ans.push_back({xs[xs.size() - 2].first - xs[0].first, xs[xs.size() - 2].second * 100000ll + xs[0].second});
    ans.push_back({xs[xs.size() - 1].first - xs[1].first, xs[xs.size() - 1].second * 100000ll + xs[1].second});

    ans.push_back({ys[ys.size() - 1].first - ys[0].first, ys[ys.size() - 1].second * 100000ll + ys[0].second});
    ans.push_back({ys[ys.size() - 2].first - ys[0].first, ys[ys.size() - 2].second * 100000ll + ys[0].second});
    ans.push_back({ys[ys.size() - 1].first - ys[1].first, ys[ys.size() - 1].second * 100000ll + ys[1].second});

    sort(ALL(ans), greater<pair<ll, ll>>());
    ll id = ans[0].second;
    rep(i, ans.size())
    {
        if (ans[i].second != id)
        {
            cout << ans[i].first << endl;
            return 0;
        }
    }
}

#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
using ll = long long;
void push(vector<pair<ll, ll>> vec, vector<pair<ll, ll>>& aft) {
	aft.at(0) = vec.at(0);
	aft.at(1) = vec.at(1);
	aft.at(2) = vec.at(vec.size() - 2);
	aft.at(3) = vec.at(vec.size() - 1);
}
int main() {
	int n;
	cin >> n;
	vector<pair<ll, ll>> x(n);
	vector<pair<ll, ll>> y(n);
	for (int i = 0; i < n; i++) {
		cin >> x.at(i).first >> y.at(i).first;
		x.at(i).second = i;
		y.at(i).second = i;
	}
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());
	vector<pair<ll,ll>> aftx (4);
	vector<pair<ll, ll>> afty(4);
	push(x, aftx); push(y, afty);
	vector<tuple<ll, ll, ll>> ans;
	for (int i = 0; i < 3; i++) {
		for (int j = i + 1; j < 4; j++) {
			ans.push_back(make_tuple(
				abs(aftx.at(i).first 
					- aftx.at(j).first),
				aftx.at(i).second,
				aftx.at(j).second));
		}
	}
	for (int i = 0; i < 3; i++) {
		for (int j = i + 1; j < 4; j++) {
			ans.push_back(make_tuple(
				abs(afty.at(i).first 
					- afty.at(j).first),
				afty.at(i).second,
				afty.at(j).second));
		}
	}
	sort(ans.begin(), ans.end());
	//2,3番の要素を整列
	if (get<1>(ans.at(ans.size() - 1))
		< get<2>(ans.at(ans.size() - 1))) {
		swap(get<1>(ans.at(ans.size() - 1)),
			get<2>(ans.at(ans.size() - 1)));
	}
	if (get<1>(ans.at(ans.size() - 2))
		< get<2>(ans.at(ans.size() - 2))) {
		swap(get<1>(ans.at(ans.size() - 2)),
			get<2>(ans.at(ans.size() - 2)));
	}
	if (ans.at(ans.size() - 1) 
		== ans.at(ans.size() - 2)) {
		ans.erase(ans.end() - 2);
	}
	cout << get<0>(ans.at(ans.size() - 2)) << endl;
}