#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18 + 18;
const int inf = 2e9;
const ll N = 1e3 + 3;
ll pt[N][2];
ll n, f;
vector<ll> vis(N, 0);
map<ll, vector<ll> > X;
map<ll, vector<ll> > Y;
vector<ll> com[7];
void dfs(ll s, ll t) {
  if (s < 1 || s > n) cout << "AAH";
  vis[s] = f;
  com[f].emplace_back(s);
  auto x = pt[s][0];
  auto y = pt[s][1];
  for (auto i : X[x])
    if (!vis[i] && llabs(pt[i][1] - y) <= t) dfs(i, t);
  for (auto i : Y[y])
    if (!vis[i] && llabs(pt[i][0] - x) <= t) dfs(i, t);
}
bool chk(ll t) {
  for (int i = 0; i < 6; i++) com[i].clear();
  vis.assign(N, 0);
  f = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      f++;
      dfs(i, t);
      if (f > 4) break;
    }
  if (f == 1) {
    return 1;
  } else if (f == 2) {
    for (auto i : com[1]) {
      for (auto j : com[2]) {
        if (i > n || j > n || i < 1 || j < 1) cout << "aah";
        if (pt[i][0] == pt[j][0] && llabs(pt[i][1] - pt[j][1]) <= 2 * t)
          return 1;
        if (pt[i][1] == pt[j][1] && llabs(pt[i][0] - pt[j][0]) <= 2 * t)
          return 1;
        if (llabs(pt[i][0] - pt[j][0]) <= t && llabs(pt[i][1] - pt[j][1]) <= t)
          return 1;
      }
    }
  } else if (f == 3) {
    int comb[][3] = {{1, 2, 3}, {1, 3, 2}, {2, 3, 1}};
    for (int loop = 0; loop < 3; loop++) {
      auto a = comb[loop][0];
      auto b = comb[loop][1];
      auto c = comb[loop][2];
      vector<pll> segx, segy;
      for (auto i : com[a]) {
        for (auto j : com[b]) {
          if (pt[i][0] == pt[j][0] && llabs(pt[i][1] - pt[j][1]) <= 2 * t)
            segx.emplace_back(i, j);
          if (pt[i][1] == pt[j][1] && llabs(pt[i][0] - pt[j][0]) <= 2 * t)
            segy.emplace_back(i, j);
        }
      }
      for (auto seg : segy) {
        for (auto p : com[c]) {
          auto x1 = min(pt[seg.first][0], pt[seg.second][0]);
          auto x2 = max(pt[seg.first][0], pt[seg.second][0]);
          if (pt[p][0] <= x2 && pt[p][0] >= x1) {
            if (pt[p][0] - x1 <= t && x2 - pt[p][0] <= t &&
                llabs(pt[seg.first][1] - pt[p][1]) <= t)
              return 1;
          }
        }
      }
      for (auto seg : segx) {
        for (auto p : com[c]) {
          auto y1 = min(pt[seg.first][1], pt[seg.second][1]);
          auto y2 = max(pt[seg.first][1], pt[seg.second][1]);
          if (pt[p][1] <= y2 && pt[p][1] >= y1) {
            if (pt[p][1] - y1 <= t && y2 - pt[p][1] <= t &&
                llabs(pt[seg.first][0] - pt[p][0]) <= t)
              return 1;
          }
        }
      }
    }
  } else if (f == 4) {
    int comb[][4] = {{1, 2, 3, 4}, {1, 3, 2, 4}, {1, 4, 2, 3}};
    for (int loop = 0; loop < 3; loop++) {
      auto a = comb[loop][0];
      auto b = comb[loop][1];
      auto c = comb[loop][2];
      auto d = comb[loop][3];
      vector<pll> segx[2], segy[2];
      for (auto i : com[a]) {
        for (auto j : com[b]) {
          if (pt[i][0] == pt[j][0] && llabs(pt[i][1] - pt[j][1]) <= 2 * t)
            segx[0].emplace_back(i, j);
          if (pt[i][1] == pt[j][1] && llabs(pt[i][0] - pt[j][0]) <= 2 * t)
            segy[0].emplace_back(i, j);
        }
      }
      for (auto i : com[c]) {
        for (auto j : com[d]) {
          if (pt[i][0] == pt[j][0] && llabs(pt[i][1] - pt[j][1]) <= 2 * t)
            segx[1].emplace_back(i, j);
          if (pt[i][1] == pt[j][1] && llabs(pt[i][0] - pt[j][0]) <= 2 * t)
            segy[1].emplace_back(i, j);
        }
      }
      for (auto s0 : segy[0]) {
        for (auto s1 : segx[1]) {
          auto x1 = min(pt[s0.first][0], pt[s0.second][0]);
          auto x2 = max(pt[s0.first][0], pt[s0.second][0]);
          auto x3 = pt[s1.first][0];
          auto y3 = min(pt[s1.first][1], pt[s1.second][1]);
          auto y4 = max(pt[s1.first][1], pt[s1.second][1]);
          auto y1 = pt[s0.first][1];
          if (x3 - x1 <= t && x2 - x3 <= t && y4 - y1 <= t && y1 - y3 <= t)
            return 1;
        }
      }
      for (auto s0 : segy[1]) {
        for (auto s1 : segx[0]) {
          auto x1 = min(pt[s0.first][0], pt[s0.second][0]);
          auto x2 = max(pt[s0.first][0], pt[s0.second][0]);
          auto x3 = pt[s1.first][0];
          auto y3 = min(pt[s1.first][1], pt[s1.second][1]);
          auto y4 = max(pt[s1.first][1], pt[s1.second][1]);
          auto y1 = pt[s0.first][1];
          if (x3 - x1 <= t && x2 - x3 <= t && y4 - y1 <= t && y1 - y3 <= t)
            return 1;
        }
      }
    }
  }
  return 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> pt[i][0] >> pt[i][1];
  for (int i = 1; i <= n; i++) {
    auto x = pt[i][0];
    auto y = pt[i][1];
    X[x].emplace_back(i);
    Y[y].emplace_back(i);
  }
  ll L = 0, R = 2e9 + 9;
  while (L <= R) {
    ll mid = (L + R) / 2;
    if (chk(mid))
      R = mid - 1;
    else
      L = mid + 1;
  }
  if (L > (ll)2e9) L = -1;
  cout << L;
}
