#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 5;
const int inf = 2e9 + 7;
int n, x[N], y[N], f[N], cnt1, cnt2, idx[N], idy[N], p1[N], p2[N];
vector<pair<int, int> > v1[N], v2[N];
unordered_map<int, int> M1, M2;
bool vis[N];
inline int ID1(int x) {
  if (M1.count(x)) return M1[x];
  M1[x] = ++cnt1;
  return cnt1;
}
inline int ID2(int x) {
  if (M2.count(x)) return M2[x];
  M2[x] = ++cnt2;
  return cnt2;
}
int find(int x) {
  if (f[x] == x) return x;
  return f[x] = find(f[x]);
}
inline void un(int u, int v) {
  int fx = find(u), fy = find(v);
  if (fx != fy) f[fx] = fy;
}
bool ck(long long t) {
  for (int i = (1); i < (n + 1); i++) f[i] = i;
  for (int i = (1); i < (n + 1); i++)
    for (int j = (1); j < (n + 1); j++) {
      if (i == j) continue;
      if (x[i] == x[j] && abs(y[i] - y[j]) <= t) un(i, j);
      if (y[i] == y[j] && abs(x[i] - x[j]) <= t) un(i, j);
    }
  int cnt = 0;
  vector<int> tmp;
  for (int i = (1); i < (n + 1); i++)
    if (find(i) == i) tmp.push_back(i), cnt++;
  if (cnt == 1) return true;
  if (cnt > 4) return false;
  if (cnt == 2) {
    for (int i = (1); i < (n + 1); i++)
      for (int j = (1); j < (n + 1); j++) {
        if (find(i) == tmp[0] && find(j) == tmp[1]) {
          if (x[i] == x[j] && abs(y[i] - y[j]) <= (long long)2 * t) return true;
          if (y[i] == y[j] && abs(x[i] - x[j]) <= (long long)2 * t) return true;
          if (max(abs(y[i] - y[j]), abs(x[i] - x[j])) <= t) return true;
        }
      }
    return false;
  } else {
    vector<int> g;
    for (int i = (1); i < (n + 1); i++)
      for (int j = (1); j < (n + 1); j++) {
        if (i == j) continue;
        int xx = idx[i], yy = idy[j];
        int id;
        id = p1[i];
        g.clear();
        if (id > 0) {
          pair<int, int> c1 = v1[xx][id - 1];
          if (abs(y[j] - c1.first) <= t) g.push_back(find(c1.second));
        }
        if (id < (int)v1[xx].size()) {
          pair<int, int> c2 = v1[xx][id];
          if (abs(c2.first - y[j]) <= t) g.push_back(find(c2.second));
        }
        id = p2[j];
        if (id > 0) {
          pair<int, int> c1 = v2[yy][id - 1];
          if (abs(x[i] - c1.first) <= t) g.push_back(find(c1.second));
        }
        if (id < (int)v2[yy].size()) {
          pair<int, int> c2 = v2[yy][id];
          if (abs(c2.first - x[i]) <= t) g.push_back(find(c2.second));
        }
        int cc = 0;
        for (auto it : g)
          if (!vis[it]) cc++, vis[it] = true;
        for (auto it : g) vis[it] = false;
        if (cc == cnt) return true;
      }
    return false;
  }
}
int main() {
  cnt1 = cnt2 = 0;
  scanf("%d", &n);
  for (int i = (1); i < (n + 1); i++) {
    scanf("%d%d", &x[i], &y[i]);
    idx[i] = ID1(x[i]);
    idy[i] = ID2(y[i]);
    v1[idx[i]].push_back(pair<int, int>(y[i], i));
    v2[idy[i]].push_back(pair<int, int>(x[i], i));
  }
  for (int i = (1); i < (cnt1 + 1); i++) sort(v1[i].begin(), v1[i].end());
  for (int i = (1); i < (cnt2 + 1); i++) sort(v2[i].begin(), v2[i].end());
  for (int i = (1); i < (n + 1); i++) {
    p1[i] = lower_bound(v1[idx[i]].begin(), v1[idx[i]].end(),
                        pair<int, int>(y[i], 0)) -
            v1[idx[i]].begin();
    p2[i] = lower_bound(v2[idy[i]].begin(), v2[idy[i]].end(),
                        pair<int, int>(x[i], 0)) -
            v2[idy[i]].begin();
  }
  int ans = inf;
  long long L = 1, R = inf;
  while (L <= R) {
    long long mid = (L + R) / 2;
    if (ck(mid)) {
      ans = mid;
      R = mid - 1;
    } else
      L = mid + 1;
  }
  if (ans == inf) ans = -1;
  printf("%d\n", ans);
  return 0;
}
