#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> arr[1010];
long long parent[1010], sz[1010], nxt[1010][4];
long long roll_sz = -1;
pair<long long, long long> roll[1010];
long long findparent(long long k, bool r) {
  long long x = k;
  while (k != parent[k]) k = parent[k];
  if (!r) {
    if (parent[k] != k) parent[k] = findparent(parent[k], r);
    return parent[k];
  }
  return (parent[k] != k) ? findparent(parent[k], r) : k;
}
bool union_set(long long a, long long b, bool r) {
  a = findparent(a, r);
  b = findparent(b, r);
  if (a == b) return 0;
  if (sz[a] > sz[b]) {
    parent[b] = a;
    sz[a] += sz[b];
    roll[++roll_sz] = {b, a};
  } else {
    parent[a] = b;
    sz[b] += sz[a];
    roll[++roll_sz] = {a, b};
  }
  return 1;
}
void roll_back() {
  while (roll_sz >= 0) {
    pair<long long, long long> x = roll[roll_sz];
    parent[x.first] = x.first;
    sz[x.second] -= sz[x.first];
    roll_sz--;
  }
}
void save() { roll_sz = -1; }
long long dist(pair<long long, long long> x, pair<long long, long long> y) {
  return abs(x.first - y.first) + abs(x.second - y.second);
}
bool chck(long long k, long long n) {
  long long i, j;
  for (i = 1; i <= n; i++) parent[i] = i, sz[i] = 1;
  long long parts = n;
  save();
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      if ((arr[i].first == arr[j].first || arr[i].second == arr[j].second) &&
          dist(arr[i], arr[j]) <= k)
        parts -= union_set(i, j, 0);
    }
  }
  save();
  for (i = 1; i <= n; i++) parent[i] = findparent(i, 0);
  if (parts == 1) return 1;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      if (j == i) continue;
      long long temp_parts = parts;
      if (arr[i].first == arr[j].first || arr[i].second == arr[j].second) {
        if (dist(arr[i], arr[j]) > k && dist(arr[i], arr[j]) <= 2 * k) {
          temp_parts -= union_set(i, j, 1);
        }
      } else {
        pair<long long, long long> res =
            pair<long long, long long>(arr[i].first, arr[j].second);
        if (dist(arr[i], res) <= k && dist(arr[j], res) <= k) {
          temp_parts -= union_set(i, j, 1);
        }
        long long x, y = i;
        if (arr[i].second < res.second)
          x = nxt[i][0];
        else
          x = nxt[i][2];
        if (x != -1 && dist(arr[x], res) <= k && dist(arr[y], res) <= k) {
          temp_parts -= union_set(x, y, 1);
        }
        if (arr[j].first < res.first)
          x = nxt[j][1];
        else
          x = nxt[j][3];
        if (x != -1 && dist(arr[x], res) <= k && dist(arr[y], res) <= k) {
          temp_parts -= union_set(x, y, 1);
        }
      }
      roll_back();
      if (temp_parts == 1) return 1;
    }
  return 0;
}
long long bsrch(long long strt, long long ed, long long n) {
  long long ans = -1;
  while (strt <= ed) {
    long long mid = (strt + ed) / 2;
    if (chck(mid, n))
      ans = mid, ed = mid - 1;
    else
      strt = mid + 1;
  }
  return ans;
}
void solveTestCase() {
  long long i, j, k, l, n, m;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> arr[i].first >> arr[i].second;
    parent[i] = i;
    sz[i] = 1;
    nxt[i][0] = nxt[i][1] = nxt[i][2] = nxt[i][3] = -1;
  }
  sort(arr + 1, arr + n + 1);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      if (arr[i].first == arr[j].first || arr[i].second == arr[j].second) {
        if (arr[i].first < arr[j].first) {
          if (nxt[i][1] == -1 || arr[nxt[i][1]].first > arr[j].first)
            nxt[i][1] = j;
        }
        if (arr[i].first > arr[j].first) {
          if (nxt[i][3] == -1 || arr[nxt[i][3]].first < arr[j].first)
            nxt[i][3] = j;
        }
        if (arr[i].second < arr[j].second) {
          if (nxt[i][0] == -1 || arr[nxt[i][0]].second > arr[j].second)
            nxt[i][0] = j;
        }
        if (arr[i].second > arr[j].second) {
          if (nxt[i][2] == -1 || arr[nxt[i][2]].second < arr[j].second)
            nxt[i][2] = j;
        }
      }
    }
  cout << bsrch(0, 2e9, n) << '\n';
}
int main() {
  long long t, n, i, j, k, l, m;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long p;
  t = 1;
  for (long long T = 1; T <= t; T++) {
    solveTestCase();
  }
  return 0;
}
