#include <bits/stdc++.h>
using namespace std;
const int MX = 1005, inf = int(2e9) + 5;
int n, f[MX], p[MX], sz;
vector<pair<int, int>> a;
map<pair<int, int>, set<int>> mp;
vector<int> t[2 * MX * MX], d[2 * MX * MX];
int parent(int a) { return a == p[a] ? a : p[a] = parent(p[a]); }
void join(int a, int b) { p[parent(a)] = parent(b); }
int dis(const pair<int, int> &a, const pair<int, int> &b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
bool esPos(int m) {
  iota(p, p + n, 0);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < i; j++)
      if (a[i].first == a[j].first || a[i].second == a[j].second)
        if (dis(a[i], a[j]) <= m) join(i, j);
  set<int> st;
  for (int i = 0; i < n; i++) st.insert(parent(i));
  if (st.size() > 4) return 0;
  if (st.size() == 1) return 1;
  int mk = 0;
  for (int x : st) f[x] = mk++;
  for (int i = 0; i < n; i++) f[i] = f[p[i]];
  for (int i = 0; i < sz; i++) {
    int mk = 0;
    for (int j = 0; j < t[i].size(); j++)
      if (d[i][j] <= m) mk |= 1 << f[t[i][j]];
    if (__builtin_popcount(mk) == st.size()) return 1;
  }
  return 0;
}
void insert(int i, int j, const pair<int, int> &p) {
  mp[p].insert(i);
  mp[p].insert(j);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < i; j++) {
      if (a[i].first == a[j].first)
        insert(i, j, {a[i].first, (a[i].second + a[j].second) / 2});
      else if (a[i].second == a[j].second)
        insert(i, j, {(a[i].first + a[j].first) / 2, a[i].second});
      else
        insert(i, j, {a[i].first, a[j].second}),
            insert(i, j, {a[j].first, a[i].second});
    }
  for (const auto &it : mp) {
    for (const int &jt : it.second) {
      t[sz].push_back(jt);
      d[sz].push_back(dis(it.first, a[jt]));
    }
    sz++;
  }
  int i = 1, j = inf, rep = 32;
  while (rep--) {
    int m = (1ll + i + j) / 2;
    if (esPos(m))
      j = m;
    else
      i = m;
  }
  if (j == inf)
    cout << -1 << '\n';
  else
    cout << j << '\n';
  return 0;
}
