#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
struct DSU {
  vector<int> pai, ps;
  int comp;
  DSU() {}
  DSU(int n) {
    comp = n;
    pai.resize(n + 1);
    ps.resize(n + 1);
    for (int i = 1; i <= n; i++) {
      pai[i] = i;
      ps[i] = 1;
    }
  }
  int f(int x) { return pai[x] = pai[x] == x ? x : f(pai[x]); }
  void join(int a, int b) {
    a = f(a), b = f(b);
    if (a == b) return;
    if (ps[a] > ps[b]) swap(a, b);
    ps[b] += ps[a];
    pai[a] = b;
    comp--;
  }
};
const int N = 1010;
int x[N], y[N];
int n;
const int inf = 2e9 + 1;
long long dist(int i, int j) {
  if (x[i] != x[j] and y[i] != y[j]) return inf;
  return abs(x[i] - x[j]) + abs(y[i] - y[j]);
}
struct coisa {
  int i, j;
};
pair<int, int> inter(int a, int b, int c, int d) {
  if (y[a] < y[c] || y[a] > y[d]) return pair<int, int>(inf, inf);
  if (x[c] < x[a] || x[c] > x[b]) return pair<int, int>(inf, inf);
  return pair<int, int>(x[c], y[a]);
}
int dist3(pair<int, int> A, pair<int, int> B) {
  return abs(A.first - B.first) + abs(A.second - B.second);
}
bool good(int a, int b, int c, int d, int mx) {
  pair<int, int> T = inter(a, b, c, d);
  if (T.first == inf) return 0;
  vector<int> v = {a, b, c, d};
  for (int i = 0; i < (4); ++i)
    if (dist3(T, pair<int, int>(x[v[i]], y[v[i]])) > mx) return 0;
  return 1;
}
bool ok(int T) {
  DSU dsu(n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++)
      if (dist(i, j) <= T) {
        dsu.join(i, j);
      }
  }
  if (dsu.comp == 1) return 1;
  if (dsu.comp > 4) return 0;
  if (dsu.comp == 2) {
    for (int i = 1; i < (n + 1); ++i)
      for (int j = 1; j < (i); ++j) {
        if (dsu.f(i) != dsu.f(j)) {
          if ((x[i] == x[j] || y[i] == y[j]) and
              (long long) dist(i, j) <= (long long)2 * T)
            return 1;
          if (max(abs(x[i] - x[j]), abs(y[i] - y[j])) <= T) return 1;
        }
      }
    return 0;
  }
  vector<pair<int, int> > hor, vert;
  vector<int> ids;
  for (int i = 1; i <= n; i++) ids.push_back(i);
  sort(ids.begin(), ids.end(), [&](int a, int b) {
    if (y[a] == y[b]) return x[a] < x[b];
    return y[a] < y[b];
  });
  for (int j = 0; j < ((int)ids.size()) - 1; j++) {
    if (y[ids[j]] == y[ids[j + 1]] and dsu.f(ids[j]) != dsu.f(ids[j + 1])) {
      hor.push_back(pair<int, int>(ids[j], ids[j + 1]));
    }
  }
  sort(ids.begin(), ids.end(), [&](int a, int b) {
    if (x[a] == x[b]) return y[a] < y[b];
    return x[a] < x[b];
  });
  for (int j = 0; j < ((int)ids.size()) - 1; j++) {
    if (x[ids[j]] == x[ids[j + 1]] and dsu.f(ids[j]) != dsu.f(ids[j + 1])) {
      vert.push_back(pair<int, int>(ids[j], ids[j + 1]));
    }
  }
  if (dsu.comp == 3) {
    for (int k = 1; k <= n; k++) {
      for (auto it : hor) {
        if (dsu.f(it.first) == dsu.f(k) || dsu.f(it.second) == dsu.f(k))
          continue;
        assert(x[it.first] <= x[it.second]);
        if (abs(y[it.first] - y[k]) <= T and x[it.first] <= x[k] and
            x[k] <= x[it.second] and x[k] - x[it.first] <= T and
            x[it.second] - x[k] <= T)
          return 1;
      }
      for (auto it : vert) {
        if (dsu.f(it.first) == dsu.f(k) || dsu.f(it.second) == dsu.f(k))
          continue;
        if (abs(x[it.first] - x[k]) <= T and y[it.first] <= y[k] and
            y[k] <= y[it.second] and y[k] - y[it.first] <= T and
            y[it.second] - y[k] <= T)
          return 1;
      }
    }
    return 0;
  } else {
    for (auto it : hor) {
      for (auto it2 : vert) {
        if (dsu.f(it.first) == dsu.f(it2.first) ||
            dsu.f(it.first) == dsu.f(it2.second))
          continue;
        if (dsu.f(it.second) == dsu.f(it2.first) ||
            dsu.f(it.second) == dsu.f(it2.second))
          continue;
        if (good(it.first, it.second, it2.first, it2.second, T)) return 1;
      }
    }
  }
  return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  long long L = 0, R = 2e9;
  long long ans = -1;
  while (L <= R) {
    long long mid = (L + R) / 2;
    if (ok(mid)) {
      ans = mid;
      R = mid - 1;
    } else
      L = mid + 1;
  }
  cout << ans << "\n";
}
