#include <bits/stdc++.h>
using namespace std;
int n, INF = 2e9 + 1;
vector<vector<int>> nodes;
vector<int> comp;
vector<int> x, y;
map<int, vector<pair<int, int>>> sameX, sameY;
int mulMod(long long, long long);
int addMod(int, int);
void readArray(int *, int);
void printArray(int *, int);
void dfs(int u, int id) {
  comp[u] = id;
  for (int &c : nodes[u])
    if (comp[c] == 0) dfs(c, id);
}
bool check(int curr, int t) {
  if (curr == 2) {
    for (int i = 0; i < n; i++)
      for (int j = i + 1; j < n; j++) {
        if (comp[i] == comp[j]) continue;
        if (x[i] == x[j] && abs(y[i] - y[j]) <= 2 * t) return true;
        if (y[i] == y[j] && abs(x[i] - x[j]) <= 2 * t) return true;
        if (abs(x[i] - x[j]) <= t && abs(y[i] - y[j]) <= t) return true;
      }
    return false;
  } else if (curr == 3) {
    vector<pair<int, int>> seg;
    for (auto &p : sameX) {
      for (int i = 1; i < (int)p.second.size(); i++)
        if (comp[p.second[i].second] != comp[p.second[i - 1].second])
          seg.push_back({p.second[i].second, p.second[i - 1].second});
    }
    for (auto &p : sameY) {
      for (int i = 1; i < (int)p.second.size(); i++)
        if (comp[p.second[i].second] != comp[p.second[i - 1].second])
          seg.push_back({p.second[i].second, p.second[i - 1].second});
    }
    for (auto &el : seg) {
      int i = el.first, j = el.second;
      for (int k = 0; k < n; k++) {
        if (comp[k] == comp[i] || comp[k] == comp[j]) continue;
        if (x[i] == x[j]) {
          if (min(y[i], y[j]) >= y[k] || max(y[i], y[j]) <= y[k]) continue;
          if (abs(x[i] - x[k]) > t) continue;
          if (abs(y[i] - y[k]) <= t && abs(y[j] - y[k]) <= t) return true;
        } else {
          if (min(x[i], x[j]) >= x[k] || max(x[i], x[j]) <= x[k]) continue;
          if (abs(y[i] - y[k]) > t) continue;
          if (abs(x[i] - x[k]) <= t && abs(x[j] - x[k]) <= t) return true;
        }
      }
    }
    return false;
  }
  vector<pair<int, int>> segX, segY;
  for (auto &p : sameX) {
    for (int i = 1; i < (int)p.second.size(); i++)
      if (comp[p.second[i].second] != comp[p.second[i - 1].second])
        segX.push_back({p.second[i].second, p.second[i - 1].second});
  }
  for (auto &p : sameY) {
    for (int i = 1; i < (int)p.second.size(); i++)
      if (comp[p.second[i].second] != comp[p.second[i - 1].second])
        segY.push_back({p.second[i].second, p.second[i - 1].second});
  }
  for (auto &el1 : segX)
    for (auto &el2 : segY) {
      int a = el1.first, b = el1.second, c = el2.first, d = el2.second;
      if (comp[a] == comp[c] || comp[a] == comp[d] || comp[b] == comp[c] ||
          comp[b] == comp[d])
        continue;
      if (min(y[a], y[b]) >= y[c]) continue;
      if (max(y[a], y[b]) <= y[c]) continue;
      if (min(x[c], x[d]) >= x[a]) continue;
      if (max(x[c], x[d]) <= x[a]) continue;
      int x0 = x[a], y0 = y[c];
      if (abs(y[a] - y0) <= t && abs(y[b] - y0) <= t)
        if (abs(x[c] - x0) <= t && abs(x[d] - x0) <= t) return true;
    }
  return false;
}
bool ok(int t) {
  nodes.clear();
  nodes.resize(n);
  comp.assign(n, 0);
  for (auto &p : sameX) {
    for (int i = 1; i < (int)p.second.size(); i++)
      if (p.second[i].first - p.second[i - 1].first <= t) {
        nodes[p.second[i].second].push_back(p.second[i - 1].second);
        nodes[p.second[i - 1].second].push_back(p.second[i].second);
      }
  }
  for (auto &p : sameY) {
    for (int i = 1; i < (int)p.second.size(); i++)
      if (p.second[i].first - p.second[i - 1].first <= t) {
        nodes[p.second[i].second].push_back(p.second[i - 1].second);
        nodes[p.second[i - 1].second].push_back(p.second[i].second);
      }
  }
  int curr = 1;
  for (int i = 0; i < n; i++) {
    if (comp[i] != 0) continue;
    dfs(i, curr);
    curr++;
  }
  curr--;
  if (curr > 4) return false;
  if (curr == 1) return true;
  return check(curr, t);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  x.resize(n), y.resize(n);
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n; i++) {
    sameX[x[i]].push_back({y[i], i});
    sameY[y[i]].push_back({x[i], i});
  }
  for (auto &p : sameX) sort(p.second.begin(), p.second.end());
  for (auto &p : sameY) sort(p.second.begin(), p.second.end());
  long long l = 1, r = INF, mid, ans = INF;
  while (l <= r) {
    mid = (l + r) >> 1LL;
    if (ok(mid)) {
      ans = min(ans, mid);
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << (ans == INF ? -1 : ans) << endl;
  return 0;
}
int mulMod(long long a, long long b) {
  a *= b;
  a %= 1000000007;
  return (int)a;
}
int addMod(int a, int b) {
  long long c = a + b;
  if (c >= 1000000007) {
    c -= 1000000007;
  }
  return (int)c;
}
void readArray(int *nums, int n) {
  for (int i = 0; i < n; i++) cin >> nums[i];
}
void printArray(int *nums, int n) {
  for (int i = 0; i < n; i++) cout << nums[i] << " ";
  cout << endl;
}
