#include <bits/stdc++.h>
using namespace std;
struct node {
  long long x;
  long long y;
} p[1010];
int n;
int fa[1010];
int head[1010];
unordered_map<long long, int> fx;
unordered_map<long long, int> fy;
int vis[1010][1010];
int vis1[1010];
int tc;
long long read() {
  int f = 1;
  long long ans = 0;
  char ch;
  ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ans = 10 * ans + ch - '0';
    ch = getchar();
  }
  return 1LL * f * ans;
}
void init() {
  for (int i = 0; i <= n; i++) {
    fa[i] = i;
    vis1[i] = 0;
    head[i] = 0;
  }
}
long long func(int i, int j) {
  return max(abs(p[i].x - p[j].x), abs(p[i].y - p[j].y));
}
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
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 && abs(p[i].y - p[j].y) <= len) ||
          (p[i].y == p[j].y && abs(p[i].x - p[j].x) <= len)) {
        fa[find(i)] = find(j);
      }
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis1[find(i)]) {
      vis1[find(i)] = ++cnt;
      head[cnt] = find(i);
    }
  }
  if (cnt == 1) return true;
  if (cnt == 2) {
    long long dist = 5e9 + 7;
    for (int i = 1; i <= n; i++) {
      if (find(i) != head[1]) continue;
      for (int j = 1; j <= n; j++) {
        if (find(j) != head[2]) continue;
        if (p[i].x == p[j].x) {
          dist = min(dist, (abs(p[i].y - p[j].y) + 1) / 2);
        } else if (p[i].y == p[j].y) {
          dist = min(dist, (abs(p[i].x - p[j].x) + 1) / 2);
        } else {
          dist = min(dist, func(i, j));
        }
      }
    }
    return dist <= len;
  }
  if (cnt == 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) != head[qwq[1]]) continue;
        for (int j = 1; j <= n; j++) {
          if (find(j) != head[qwq[2]]) continue;
          if (func(i, j) <= len) {
            vis[fx[p[i].x]][fy[p[j].y]] = tc;
            vis[fx[p[j].x]][fy[p[i].y]] = tc;
          }
        }
      }
      for (int i = 1; i <= n; i++) {
        if (find(i) != head[qwq[1]]) continue;
        for (int j = 1; j <= n; j++) {
          if (find(j) != head[qwq[3]]) continue;
          if (func(i, j) <= len && (vis[fx[p[i].x]][fy[p[j].y]] == tc ||
                                    vis[fx[p[j].x]][fy[p[i].y]] == tc))
            return true;
        }
      }
    }
    return false;
  }
  if (cnt == 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) != head[qwq[1]]) continue;
        for (int j = 1; j <= n; j++) {
          if (find(j) != head[qwq[2]]) continue;
          if (func(i, j) <= len) {
            vis[fx[p[i].x]][fy[p[j].y]] = tc;
            vis[fx[p[j].x]][fy[p[i].y]] = tc;
          }
        }
      }
      for (int i = 1; i <= n; i++) {
        if (find(i) != head[qwq[3]]) continue;
        for (int j = 1; j <= n; j++) {
          if (find(j) != head[qwq[4]]) continue;
          if (func(i, j) <= len && (vis[fx[p[i].x]][fy[p[j].y]] == tc ||
                                    vis[fx[p[j].x]][fy[p[i].y]] == tc))
            return true;
        }
      }
    }
    return false;
  }
  return false;
}
int main() {
  n = (int)read();
  for (int i = 1; i <= n; i++) {
    p[i].x = read();
    p[i].y = read();
    fx[p[i].x] = i;
    fy[p[i].y] = i;
  }
  long long l = 0, r = 2e9 + 10, mid;
  while (l < r) {
    mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (r >= 2e9 + 10)
    printf("-1\n");
  else
    printf("%lld\n", r);
  return 0;
}
