#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 3) + (x << 1) + c - 48;
    c = getchar();
  }
  return x * f;
}
long long k, m, n;
struct node {
  long long x, y;
} a[1100];
long long fa[1100], Px[1100], totx = 0, Py[1100], toty = 0;
vector<pair<long long, long long>> ax[1100], ay[1100];
long long find(long long x) {
  if (x == fa[x]) return x;
  return fa[x] = find(fa[x]);
}
long long checkdis(long long x, long long y, long long xx, long long yy) {
  if (x == xx) return abs(y - yy);
  if (y == yy) return abs(x - xx);
  return inf + 1;
}
long long tot = 0, vis[5];
map<long long, long long> M;
bool check(long long mid) {
  for (long long i = 1; i <= n; i++) fa[i] = i;
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) {
      if (find(i) != find(j) && checkdis(a[i].x, a[i].y, a[j].x, a[j].y) <= mid)
        fa[find(i)] = find(j);
    }
  }
  long long num = 0;
  for (long long i = 1; i <= n; i++)
    if (find(i) == i) num++;
  if (num > 4) return false;
  if (num == 1) return true;
  if (num == 2) {
    for (long long i = 1; i <= n; i++) {
      for (long long j = i + 1; j <= n; j++) {
        if (find(i) != find(j) &&
            checkdis(a[i].x, a[i].y, a[j].x, a[j].y) <= mid * 2)
          return true;
        if (find(i) != find(j) && abs(a[i].x - a[j].x) <= mid &&
            abs(a[i].y - a[j].y) <= mid)
          return true;
      }
    }
    return false;
  }
  M.clear();
  tot = 0;
  for (long long i = 1; i <= n; i++)
    if (find(i) == i) M[i] = ++tot;
  for (long long i = 1; i <= totx; i++) {
    for (long long j = 1; j <= toty; j++) {
      vis[1] = vis[2] = vis[3] = vis[4] = 0;
      long long x1 =
          upper_bound(ax[i].begin(), ax[i].end(), make_pair(Py[j], 0ll)) -
          ax[i].begin();
      long long x2 =
          upper_bound(ay[j].begin(), ay[j].end(), make_pair(Px[i], 0ll)) -
          ay[j].begin();
      long long x3 = ax[i][x1 - 1].second, x4 = ay[j][x2 - 1].second;
      x1 = ax[i][x1].second, x2 = ay[j][x2].second;
      if (abs(a[x1].y - Py[j]) <= mid) vis[M[find(x1)]] = 1;
      if (abs(a[x2].x - Px[i]) <= mid) vis[M[find(x2)]] = 1;
      if (abs(a[x3].y - Py[j]) <= mid) vis[M[find(x3)]] = 1;
      if (abs(a[x4].x - Px[i]) <= mid) vis[M[find(x4)]] = 1;
      long long num = tot;
      for (long long u = 1; u <= 4; u++) num -= vis[u];
      if (!num) return true;
    }
  }
  return false;
}
signed main() {
  n = read();
  for (long long i = 1; i <= n; i++) {
    a[i].x = read();
    a[i].y = read();
    Px[++totx] = a[i].x;
    Py[++toty] = a[i].y;
  }
  sort(Px + 1, Px + totx + 1);
  totx = unique(Px + 1, Px + totx + 1) - Px - 1;
  sort(Py + 1, Py + toty + 1);
  toty = unique(Py + 1, Py + toty + 1) - Py - 1;
  for (long long i = 1; i <= n; i++) {
    ax[lower_bound(Px + 1, Px + totx + 1, a[i].x) - Px].push_back(
        make_pair(a[i].y, i));
    ay[lower_bound(Py + 1, Py + toty + 1, a[i].y) - Py].push_back(
        make_pair(a[i].x, i));
    ax[i].push_back(make_pair(inf, 0));
    ax[i].push_back(make_pair(-inf, 0));
    ay[i].push_back(make_pair(inf, 0));
    ay[i].push_back(make_pair(-inf, 0));
  }
  for (long long i = 1; i <= n; i++) {
    sort(ax[i].begin(), ax[i].end());
    sort(ay[i].begin(), ay[i].end());
  }
  long long l = 0, r = inf, ans = -1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(mid)) {
      r = mid - 1;
      ans = mid;
    } else
      l = mid + 1;
  }
  if (ans != -1)
    printf("%lld\n", ans);
  else
    puts("-1");
  return 0;
}
