#include <bits/stdc++.h>
using namespace std;
struct DSU {
  int comps;
  vector<int> fa, sz;
  DSU() {}
  DSU(int n) : fa(n), sz(n, 1), comps(n) { iota(fa.begin(), fa.end(), 0); }
  bool same(int x, int y) { return find(x) == find(y); }
  bool join(int x, int y) {
    int a = find(x), b = find(y);
    if (a != b) {
      if (sz[a] < sz[b]) swap(a, b);
      sz[a] += sz[b];
      fa[b] = a;
      comps--;
      return true;
    }
    return false;
  }
  int find(int x) {
    if (x == fa[x]) return x;
    return fa[x] = find(fa[x]);
  }
};
void solve() {
  constexpr long long INF = 2147483647;
  int N;
  cin >> N;
  vector<int> X(N), Y(N);
  map<int, vector<pair<int, int>>> samex, samey;
  for (int i = 0; i < N; i++) {
    cin >> X[i] >> Y[i];
    samex[X[i]].emplace_back(Y[i], i);
    samey[Y[i]].emplace_back(X[i], i);
  }
  for (auto &[x, v] : samex) {
    sort(v.begin(), v.end());
  }
  for (auto &[y, v] : samey) {
    sort(v.begin(), v.end());
  }
  auto can = [&](long long t) {
    DSU dsu(N);
    for (auto &[x, v] : samex) {
      for (int i = 0; i < (int)v.size() - 1; i++) {
        if (v[i + 1].first - v[i].first <= t) {
          dsu.join(v[i].second, v[i + 1].second);
        }
      }
    }
    for (auto &[y, v] : samey) {
      for (int i = 0; i < (int)v.size() - 1; i++) {
        if (v[i + 1].first - v[i].first <= t) {
          dsu.join(v[i].second, v[i + 1].second);
        }
      }
    }
    int cc = dsu.comps;
    if (cc > 4) return false;
    if (cc == 1) {
      return true;
    } else if (cc == 2) {
      for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
          if (!dsu.same(i, j)) {
            if (X[i] == X[j] && abs(Y[i] - Y[j]) <= 2 * t ||
                Y[i] == Y[j] && abs(X[i] - X[j]) <= 2 * t ||
                abs(X[i] - X[j]) <= t && abs(Y[i] - Y[j]) <= t) {
              return true;
            }
          }
        }
      }
    }
    if (cc >= 3) {
      vector<pair<int, int>> segx, segy;
      for (auto [x, v] : samex) {
        for (int i = 0; i < (int)v.size() - 1; i++) {
          if (!dsu.same(v[i].second, v[i + 1].second) &&
              v[i + 1].first - v[i].first <= 2 * t) {
            segx.emplace_back(v[i].second, v[i + 1].second);
          }
        }
      }
      for (auto [y, v] : samey) {
        for (int i = 0; i < (int)v.size() - 1; i++) {
          if (!dsu.same(v[i].second, v[i + 1].second) &&
              v[i + 1].first - v[i].first <= 2 * t) {
            segy.emplace_back(v[i].second, v[i + 1].second);
          }
        }
      }
      if (cc == 3) {
        for (auto [i, j] : segx) {
          for (int k = 0; k < N; k++) {
            if (dsu.same(i, k) || dsu.same(j, k)) {
              continue;
            }
            assert(X[i] == X[j]);
            int tarx = X[i], tary = Y[k];
            bool ok = true;
            for (int idx : {i, j, k}) {
              ok &= abs(X[idx] - tarx) + abs(Y[idx] - tary) <= t;
            }
            if (ok) {
              return true;
            }
          }
        }
        for (auto [i, j] : segy) {
          for (int k = 0; k < N; k++) {
            if (dsu.same(i, k) || dsu.same(j, k)) {
              continue;
            }
            assert(Y[i] == Y[j]);
            int tary = Y[i], tarx = X[k];
            bool ok = true;
            for (int idx : {i, j, k}) {
              ok &= abs(X[idx] - tarx) + abs(Y[idx] - tary) <= t;
            }
            if (ok) {
              return true;
            }
          }
        }
      } else if (cc == 4) {
        for (auto [i, j] : segx) {
          for (auto [k, l] : segy) {
            if (dsu.same(i, k) || dsu.same(i, l) || dsu.same(j, k) ||
                dsu.same(j, l)) {
              continue;
            }
            assert(X[i] == X[j] && Y[k] == Y[l]);
            int tarx = X[i], tary = Y[k];
            bool ok = true;
            for (int idx : {i, j, k, l}) {
              ok &= abs(X[idx] - tarx) + abs(Y[idx] - tary) <= t;
            }
            if (ok) {
              return true;
            }
          }
        }
      }
    }
    return false;
  };
  long long l = 1, r = INF;
  while (l < r) {
    long long m = (l + r) >> 1;
    if (can(m)) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  if (l == INF) l = -1;
  cout << l << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
