#include <bits/stdc++.h>
using namespace std;
const long long N = 1005;
const long long inf = 1e10;
struct dsu {
  long long par;
  long long sz;
};
struct mapper {
  long long x_max[N];
  long long x_min[N];
  long long y_max[N];
  long long y_min[N];
  mapper() {
    for (long long i = 0; i < N; i++) {
      x_max[i] = y_max[i] = -inf;
      x_min[i] = y_min[i] = inf;
    }
  }
};
dsu node[N];
pair<long long, long long> a[N];
pair<long long, long long> b[N];
long long n;
long long find(long long x) {
  if (node[x].par == x) return x;
  return node[x].par = find(node[x].par);
}
void merge(long long x, long long y) {
  long long a = find(x);
  long long b = find(y);
  if (a == b) return;
  if (node[a].sz > node[b].sz) swap(a, b);
  node[a].par = b;
  node[b].sz += node[a].sz;
}
void reset() {
  for (long long i = 1; i <= n; i++) {
    node[i].par = i;
    node[i].sz = 1;
  }
}
bool check(long long t) {
  reset();
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++)
      if (a[i].first == a[j].first) {
        long long dis = abs(a[i].second - a[j].second);
        if (dis <= t) merge(i, j);
      } else if (a[i].second == a[j].second) {
        long long dis = abs(a[i].first - a[j].first);
        if (dis <= t) merge(i, j);
      }
  set<long long> cnt2;
  for (long long i = 1; i <= n; i++) cnt2.insert(find(i));
  long long sz = (long long)cnt2.size();
  if (sz > 4) return 0;
  if (sz < 2) return 1;
  vector<long long> cnt;
  for (auto x : cnt2) cnt.push_back(x);
  mapper go[sz];
  for (long long i = 1; i <= n; i++) {
    long long id = find(i);
    for (long long j = 0; j < sz; j++) {
      if (cnt[j] == id) {
        go[j].x_max[b[i].second] = max(a[i].first, go[j].x_max[b[i].second]);
        go[j].x_min[b[i].second] = min(a[i].first, go[j].x_min[b[i].second]);
        go[j].y_max[b[i].first] = max(a[i].second, go[j].y_max[b[i].first]);
        go[j].y_min[b[i].first] = min(a[i].second, go[j].y_min[b[i].first]);
      }
    }
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++) {
      long long ptx = b[i].first;
      long long pty = b[j].second;
      long long flag = 1;
      for (long long k = 0; k < sz; k++) {
        long long dd = (t + 1);
        dd = min(dd, abs(go[k].x_max[pty] - a[i].first));
        dd = min(dd, abs(go[k].x_min[pty] - a[i].first));
        dd = min(dd, abs(go[k].y_max[ptx] - a[j].second));
        dd = min(dd, abs(go[k].y_min[ptx] - a[j].second));
        if (dd > t) {
          flag = 0;
          break;
        }
      }
      if (flag) return 1;
    }
  if (sz == 2) {
    long long a1 = cnt[0];
    long long a2 = cnt.back();
    for (long long i = 1; i <= n; i++) {
      long long ptx = b[i].first;
      pair<long long, long long> d1;
      pair<long long, long long> d2;
      d1.first = go[0].y_min[ptx];
      d1.second = go[0].y_max[ptx];
      d2.first = go[1].y_min[ptx];
      d2.second = go[1].y_max[ptx];
      if (d2.second < d1.first) swap(d1, d2);
      if ((d2.first - d1.second) <= t + t) return 1;
    }
    for (long long i = 1; i <= n; i++) {
      long long pty = b[i].second;
      pair<long long, long long> d1;
      pair<long long, long long> d2;
      d1.first = go[0].x_min[pty];
      d1.second = go[0].x_max[pty];
      d2.first = go[1].x_min[pty];
      d2.second = go[1].x_max[pty];
      if (d2.second < d1.first) swap(d1, d2);
      if ((d2.first - d1.second) <= t + t) return 1;
    }
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  vector<long long> xx;
  for (long long i = 1; i <= n; i++) xx.push_back(a[i].first);
  sort(xx.begin(), xx.end());
  for (long long i = 1; i <= n; i++)
    b[i].first = lower_bound(xx.begin(), xx.end(), a[i].first) - xx.begin();
  vector<long long> yy;
  for (long long i = 1; i <= n; i++) yy.push_back(a[i].second);
  sort(yy.begin(), yy.end());
  for (long long i = 1; i <= n; i++)
    b[i].second = lower_bound(yy.begin(), yy.end(), a[i].second) - yy.begin();
  long long l = 0;
  long long r = 2e9;
  long long res = -1;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      res = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  cout << res;
}
