#include <bits/stdc++.h>
using namespace std;
map<int, int> bz;
int n, b[1100], m, r[2][1100];
long long t;
vector<int> d[5];
struct pt {
  int x, y;
  long long friend operator*(pt a, pt b) {
    if (a.x == b.x) return abs(a.y - b.y);
    if (a.y == b.y) return abs(a.x - b.x);
    return 0x3fffffffff;
  }
};
pt a[1100];
struct node {
  long long l = 0x3fffffffff, r = -0x3fffffffff;
  void ins(long long x) {
    l = min(l, x);
    r = max(r, x);
  }
  bool vld(long long x) {
    if (x >= l - t && x <= r + t) return 1;
    return 0;
  }
};
map<int, node> c[5][2];
struct bcj {
  int fa[1100];
  void clear() {
    for (int i = 1; i <= n; i++) fa[i] = i;
  }
  int gf(int x) { return fa[x] == x ? x : fa[x] = gf(fa[fa[fa[x]]]); }
  void merge(int x, int y) { fa[gf(x)] = gf(y); }
} mset;
bool vld(int u, int x, int y) {
  if (c[u][0][x].vld(y)) return 1;
  if (c[u][1][y].vld(x)) return 1;
  return 0;
}
bool work() {
  m = 0;
  memset(b, 0, sizeof(b));
  mset.clear();
  for (int i = 1; i <= 4; i++) d[i].clear();
  for (int i = 1; i <= 4; i++)
    for (int j = 0; j <= 1; j++) c[i][j].clear();
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      if (a[i] * a[j] <= t) mset.merge(i, j);
  for (int i = 1; i <= n; i++) {
    int x = mset.gf(i);
    if (!b[x])
      b[i] = b[x] = ++m;
    else
      b[i] = b[x];
  }
  if (m > 4) return 0;
  for (int i = 1; i <= n; i++) {
    c[b[i]][0][a[i].x].ins(a[i].y);
    c[b[i]][1][a[i].y].ins(a[i].x);
    d[b[i]].push_back(i);
  }
  if (m == 1) return 1;
  if (m == 2) {
    for (int i = 0, ED = d[1].size(); i < ED; i++)
      for (int j = 0, ED = d[2].size(); j < ED; j++) {
        if (a[d[1][i]] * a[d[2][j]] <= t + t) return 1;
        if (abs(a[d[1][i]].x - a[d[2][j]].x) <= t &&
            abs(a[d[1][i]].y - a[d[2][j]].y) <= t)
          return 1;
      }
  } else {
    for (int i = 1; i <= r[0][0]; i++) {
      for (int j = 1; j <= r[1][0]; j++) {
        int x = r[0][i], y = r[1][j], flag = 1;
        for (int k = 1; k <= m; k++)
          if (!vld(k, x, y)) {
            flag = 0;
            break;
          }
        if (flag) return 1;
      }
    }
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].x, &a[i].y);
  for (int i = 1; i <= n; i++)
    if (!bz[a[i].x]) r[0][++r[0][0]] = a[i].x, bz[a[i].x] = 1;
  bz.clear();
  for (int i = 1; i <= n; i++)
    if (!bz[a[i].y]) r[1][++r[1][0]] = a[i].y, bz[a[i].y] = 1;
  long long l = 0, r = 2000000001;
  t = r;
  if (!work()) return printf("-1\n"), 0;
  while (l + 1 < r) {
    long long m = (l + r) >> 1;
    t = m;
    if (work())
      r = m;
    else
      l = m;
  }
  printf("%lld\n", r);
}
