#include <bits/stdc++.h>
using namespace std;
const int MX = 1000 + 233;
int n;
unordered_map<long long, int> lshx, lshy;
struct point {
  long long x, y;
  long long mxd(point b) { return max(abs(x - b.x), abs(y - b.y)); }
} p[MX];
int fa[MX], vis[MX], lead[MX];
int tag[MX][MX], tc;
void init() {
  for (int i = 1; i <= n; ++i) fa[i] = i, vis[i] = 0;
}
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
long long X[MX], Y[MX];
bool check(long long len) {
  init();
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (p[i].x == p[j].x) {
        if (abs(p[i].y - p[j].y) <= len) {
          fa[find(i)] = find(j);
        }
      }
      if (p[i].y == p[j].y) {
        if (abs(p[i].x - p[j].x) <= len) {
          fa[find(i)] = find(j);
        }
      }
    }
  }
  int ltk = 0;
  for (int i = 1; i <= n; ++i) {
    if (!vis[find(i)]) {
      vis[find(i)] = ++ltk;
      lead[ltk] = find(i);
    }
  }
  if (ltk == 1) return true;
  if (ltk == 2) {
    long long dis = LLONG_MAX;
    for (int i = 1; i <= n; ++i) {
      if (find(i) != lead[1]) continue;
      for (int j = 1; j <= n; ++j) {
        if (find(j) != lead[2]) continue;
        if (p[i].x == p[j].x) {
          dis = min(dis, (abs(p[i].y - p[j].y) + 1) / 2);
        } else if (p[i].y == p[j].y) {
          dis = min(dis, (abs(p[i].x - p[j].x) + 1) / 2);
        } else
          dis = min(dis, p[i].mxd(p[j]));
      }
    }
    return dis <= len;
  }
  if (ltk == 3) {
    int qwq[4] = {0, 1, 2, 3};
    for (int T = 1; T <= 3; ++T) {
      ++tc;
      swap(qwq[1], qwq[T]);
      for (int i = 1; i <= n; ++i) {
        if (find(i) != lead[qwq[1]]) continue;
        for (int j = 1; j <= n; ++j) {
          if (find(j) != lead[qwq[2]]) continue;
          if (p[i].mxd(p[j]) <= len) {
            tag[lshx[p[i].x]][lshy[p[j].y]] = tc;
            tag[lshx[p[j].x]][lshy[p[i].y]] = tc;
          }
        }
      }
      for (int i = 1; i <= n; ++i) {
        if (find(i) != lead[qwq[1]]) continue;
        for (int j = 1; j <= n; ++j) {
          if (find(j) != lead[qwq[3]]) continue;
          if (p[i].mxd(p[j]) <= len) {
            if (p[i].mxd(p[j]) <= len &&
                (tag[lshx[p[i].x]][lshy[p[j].y]] == tc ||
                 tag[lshx[p[j].x]][lshy[p[i].y]] == tc))
              return 1;
          }
        }
      }
    }
    return false;
  }
  if (ltk == 4) {
    int qwq[5] = {0, 1, 2, 3, 4};
    for (int T = 1; T <= 2; ++T) {
      ++tc;
      swap(qwq[2], qwq[3]);
      for (int i = 1; i <= n; ++i) {
        if (find(i) != lead[qwq[1]]) continue;
        for (int j = 1; j <= n; ++j) {
          if (find(j) != lead[qwq[2]]) continue;
          if (p[i].mxd(p[j]) <= len) {
            tag[lshx[p[i].x]][lshy[p[j].y]] = tc;
            tag[lshx[p[j].x]][lshy[p[i].y]] = tc;
          }
        }
      }
      for (int i = 1; i <= n; ++i) {
        if (find(i) != lead[qwq[3]]) continue;
        for (int j = 1; j <= n; ++j) {
          if (find(j) != lead[qwq[4]]) continue;
          if (p[i].mxd(p[j]) <= len && (tag[lshx[p[i].x]][lshy[p[j].y]] == tc ||
                                        tag[lshx[p[j].x]][lshy[p[i].y]] == tc))
            return 1;
        }
      }
    }
    return false;
  }
  return false;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> p[i].x >> p[i].y;
    X[i] = p[i].x, Y[i] = p[i].y;
    lshx[X[i]] = i;
    lshy[Y[i]] = i;
  }
  sort(X + 1, X + 1 + n);
  sort(Y + 1, Y + 1 + n);
  long long l = 0, r = 2e9 + 1, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << ((r >= 2e9) ? -1 : (r + 1)) << endl;
  return 0;
}
