#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
long long n;
pair<long long, long long> x[N], y[N];
long long b1[N], b2[N], m1, m2;
long long fa[N], vis[N], b[N], l1[N], l2[N], r1[N], r2[N];
long long c[N][N], s1[N][N], s2[N][N];
inline long long findf(long long x) {
  return fa[x] == x ? x : fa[x] = findf(fa[x]);
}
inline long long dis(long long i, long long j) {
  if (x[i].first == x[j].first) return abs(y[i].first - y[j].first);
  if (y[i].first == y[j].first) return abs(x[i].first - x[j].first);
  return 1e18;
}
inline bool check(long long mid) {
  for (long long i = 1; i <= n; i++) fa[i] = i, vis[i] = -1, b[i] = 0;
  long long cnt = 0;
  for (long long i = 1; i <= n; i++)
    for (long long j = i + 1; j <= n; j++)
      if (dis(i, j) <= mid) {
        fa[findf(i)] = findf(j);
      }
  for (long long i = 1; i <= n; i++) {
    if (vis[findf(i)] == -1) {
      b[findf(i)] = vis[findf(i)] = cnt;
      cnt++;
    }
    b[i] = b[findf(i)];
  }
  if (cnt == 1) return 1;
  if (cnt > 4) return 0;
  for (long long i = 1; i <= n; i++) {
    l1[i] = lower_bound(b2 + 1, b2 + m2 + 1, y[i].first - mid) - b2;
    r1[i] = upper_bound(b2 + 1, b2 + m2 + 1, y[i].first + mid) - b2 - 1;
    l2[i] = lower_bound(b1 + 1, b1 + m1 + 1, x[i].first - mid) - b1;
    r2[i] = upper_bound(b1 + 1, b1 + m1 + 1, x[i].first + mid) - b1 - 1;
  }
  if (cnt == 2) {
    for (long long i = 1; i <= n; i++)
      for (long long j = i + 1; j <= n; j++)
        if (b[i] != b[j] && (max(abs(x[i].first - x[j].first),
                                 abs(y[i].first - y[j].first)) <= mid ||
                             dis(i, j) <= 2 * mid))
          return 1;
    return 0;
  }
  memset(c, 0, sizeof(c));
  for (long long t = 0; t < cnt; t++) {
    memset(s1, 0, sizeof(s1));
    memset(s2, 0, sizeof(s2));
    for (long long i = 1; i <= n; i++)
      if (b[i] == t) {
        if (l1[i] <= r1[i])
          s1[x[i].second][l1[i]]++, s1[x[i].second][r1[i] + 1]--;
        if (l2[i] <= r2[i])
          s2[l2[i]][y[i].second]++, s2[r2[i] + 1][y[i].second]--;
      }
    for (long long i = 1; i <= m1; i++)
      for (long long j = 1; j <= m2; j++) s1[i][j] += s1[i][j - 1];
    for (long long i = 1; i <= m2; i++)
      for (long long j = 1; j <= m1; j++) s2[j][i] += s2[j - 1][i];
    for (long long i = 1; i <= m1; i++)
      for (long long j = 1; j <= m2; j++) {
        if (s1[i][j] || s2[i][j]) c[i][j]++;
      }
  }
  for (long long i = 1; i <= m1; i++)
    for (long long j = 1; j <= m2; j++)
      if (c[i][j] >= cnt) {
        return 1;
      }
  return 0;
}
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++)
    scanf("%lld%lld", &y[i].first, &x[i].first), b1[++m1] = x[i].first,
                                                 b2[++m2] = y[i].first;
  sort(b1 + 1, b1 + m1 + 1);
  sort(b2 + 1, b2 + m2 + 1);
  m1 = unique(b1 + 1, b1 + m1 + 1) - b1 - 1,
  m2 = unique(b2 + 1, b2 + m2 + 1) - b2 - 1;
  for (long long i = 1; i <= n; i++) {
    x[i].second = lower_bound(b1 + 1, b1 + m1 + 1, x[i].first) - b1;
    y[i].second = lower_bound(b2 + 1, b2 + m2 + 1, y[i].first) - b2;
  }
  long long l = 1, r = 2e9, ans = -1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%lld", ans);
  return 0;
}
