#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define LI (s * 2 + 1)
#define RI (s * 2 + 2)
#define LST (l)
#define LEN ((l + r) / 2)
#define RST ((l + r) / 2 + 1)
#define REN (r)
#define ASZ (r - l + 1)
#define LSZ (LEN - LST + 1)
#define RSZ (REN - RST + 1)
struct Pt { int x, y; };
int b1(Pt p) { return + p.y; }
int b2(Pt p) { return + p.y - p.x; }
int b3(Pt p) { return - p.x; }
int b4(Pt p) { return - p.x - p.y; }
int c1(Pt p) { return + p.x - p.y; }
int c2(Pt p) { return + p.x; }
int c3(Pt p) { return + p.x + p.y; }
int c4(Pt p) { return + p.y; }
int d1(Pt p) { return + p.x + p.y; }
int d2(Pt p) { return + p.x + p.y; }
int d3(Pt p) { return - p.x + p.y; }
int d4(Pt p) { return - p.x + p.y; }
int (* bv[])(Pt p) = {b1, b2, b3, b4};
int (* cv[])(Pt p) = {c1, c2, c3, c4};
int (* dv[])(Pt p) = {d1, d2, d3, d4};
int dist(Pt a, Pt b) { return abs(a.x - b.x) + abs(a.y - b.y); }
int main() {
// ifstream fin("be2.txt");
// cin.rdbuf(fin.rdbuf());
int N;
cin >> N;
vector<Pt> v(N);
for (int i = 0; i < N; i++) {
cin >> v[i].x >> v[i].y;
}
vector<vector<pair<int, int>>> g(N);
vector<int> w(N);
iota(w.begin(), w.end(), 0);
for (int q = 0; q < 4; q++) {
sort(w.begin(), w.end(), [&](auto a, auto b) { return bv[q](v[a]) < bv[q](v[b]); });
vector<int> u(N, -1);
vector<vector<int>> st(N * 4);
function<void(int, int, int)> seg = [&](int s, int l, int r) {
if (l == r) {
st[s].push_back(w[l]);
return;
}
seg(LI, LST, LEN);
seg(RI, RST, REN);
st[s].resize(ASZ);
int i = 0, j = 0, k = 0, m = -1;
while (j < LSZ && k < RSZ) {
int aj = st[LI][j];
int ak = st[RI][k];
if (cv[q](v[aj]) > cv[q](v[ak])) {
if (m != -1 && (u[aj] == -1 || dv[q](v[m]) < dv[q](v[u[aj]]))) {
u[aj] = m;
}
st[s][i] = aj;
j++;
}
else {
if (m == -1 || dv[q](v[ak]) < dv[q](v[m])) {
m = ak;
}
st[s][i] = ak;
k++;
}
i++;
}
while (j < LSZ) {
int aj = st[LI][j];
if (m != -1 && (u[aj] == -1 || dv[q](v[m]) < dv[q](v[u[aj]]))) {
u[aj] = m;
}
st[s][i] = aj;
j++;
i++;
}
while (k < RSZ) {
st[s][i] = st[RI][k];
k++;
i++;
}
};
seg(0, 0, N - 1);
for (int j = 0; j < N; j++) {
int k = u[j];
if (k != -1) {
g[j].push_back({k, dist(v[j], v[k])});
g[k].push_back({j, dist(v[j], v[k])});
}
}
}
int ans = 0;
vector<bool> vis(N);
priority_queue<pii, vector<pii>, greater<pii>> pq;
pq.push({0, 0});
while (!pq.empty()) {
pii a = pq.top();
pq.pop();
if (vis[a.second]) {
continue;
}
vis[a.second] = true;
ans = max(ans, a.first);
for (auto p : g[a.second]) {
if (!vis[p.first]) {
pq.push({p.second, p.first});
}
}
}
cout << ans << endl;
return 0;
}