#include <bits/stdc++.h>
using namespace std;
void dfs(vector<vector<int>> &gr, vector<char> &used, int color, int v) {
  used[v] = color;
  for (int i = 0; i < gr[v].size(); i++) {
    int u = gr[v][i];
    if (!used[u]) dfs(gr, used, color, u);
  }
}
bool good(vector<long long> &x, vector<long long> &y, int n, long long t) {
  int color = 1;
  vector<char> used(n + 1, 0);
  vector<vector<int>> gr(n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (x[i] == x[j] || y[i] == y[j]) {
        if (abs(x[i] - x[j] + y[i] - y[j]) <= t) {
          gr[i].push_back(j);
          gr[j].push_back(i);
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      dfs(gr, used, color, i);
      color++;
      if (color == 6) return false;
    }
  }
  if (color == 2) return true;
  if (color == 3) {
    vector<int> comp1, comp2;
    for (int i = 1; i <= n; i++) {
      if (used[i] == 1) comp1.push_back(i);
      if (used[i] == 2) comp2.push_back(i);
    }
    for (int iter1 = 0; iter1 < comp1.size(); iter1++) {
      for (int iter2 = 0; iter2 < comp2.size(); iter2++) {
        int a = comp1[iter1], b = comp2[iter2];
        if (x[a] == x[b] || y[a] == y[b]) {
          if (2LL * t >= abs(x[a] - x[b] + y[a] - y[b])) return true;
        } else {
          if (abs(x[a] - x[b]) <= t && abs(y[a] - y[b]) <= t) return true;
        }
      }
    }
    return false;
  }
  if (color == 4) {
    vector<pair<long long, long long>> otr;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if ((x[i] == x[j] || y[i] == y[j]) && used[i] != used[j])
          otr.push_back(make_pair(i, j));
      }
    }
    for (int i = 0; i < otr.size(); i++) {
      for (int j = 1; j <= n; j++) {
        int a = otr[i].first, b = otr[i].second, c = j;
        if (used[a] == used[c] || used[b] == used[c]) continue;
        if (x[a] == x[b]) {
          if (abs(y[c] - y[b]) <= t && abs(y[c] - y[a]) <= t &&
              abs(x[a] - x[c]) <= t)
            return true;
        } else {
          if (abs(x[c] - x[a]) <= t && abs(x[c] - x[b]) <= t &&
              abs(y[c] - y[a]) <= t)
            return true;
        }
      }
    }
    return false;
  }
  if (color == 5) {
    vector<pair<long long, long long>> otr_y;
    vector<pair<long long, long long>> otr_x;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (x[i] == x[j] && used[i] != used[j])
          otr_x.push_back(make_pair(i, j));
        if (y[i] == y[j] && used[i] != used[j])
          otr_y.push_back(make_pair(i, j));
      }
    }
    for (int i = 0; i < otr_x.size(); i++) {
      for (int j = 0; j < otr_y.size(); j++) {
        int a = otr_y[j].first, b = otr_y[j].second;
        int c = otr_x[i].first, d = otr_x[i].second;
        if (used[a] == used[c] || used[a] == used[d] || used[b] == used[c] ||
            used[b] == used[d])
          continue;
        if (x[a] > x[b]) swap(a, b);
        if (y[d] > y[c]) swap(c, d);
        long long Ox = x[c], Oy = y[a];
        if (abs(Ox - x[a]) <= t && abs(Ox - x[b]) <= t && abs(Oy - y[c]) <= t &&
            abs(Oy - y[d]) <= t)
          return true;
      }
    }
    return false;
  }
}
int main() {
  int n;
  cin >> n;
  vector<long long> x(n + 1);
  vector<long long> y(n + 1);
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  long long l = 1, r = (long long)2e9 + 100;
  while (l < r) {
    long long m = l + (r - l) / 2LL;
    if (good(x, y, n, m))
      r = m;
    else
      l = m + 1LL;
  }
  if (l > (long long)2e9)
    cout << -1;
  else
    cout << l;
}
