#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const double EPS = 1e-9;
struct union_find {
  vector<int> p;
  union_find(int n) : p(n) {
    for (auto i = (0); i < (n); i++) p[i] = i;
  }
  int find(int a) { return p[a] == a ? a : p[a] = find(p[a]); }
  bool joined(int a, int b) { return find(a) == find(b); }
  void unite(int a, int b) { p[find(a)] = find(b); }
};
unordered_map<int, set<int>> X_S;
unordered_map<int, set<int>> NX_S;
unordered_map<int, set<int>> Y_S;
unordered_map<int, set<int>> NY_S;
map<pair<int, int>, int> IND;
bool g(pair<int, int> a, pair<int, int> b, int distance) {
  if (a.first == b.first) {
    return abs(a.second - b.second) <= distance;
  } else if (a.second == b.second) {
    return abs(a.first - b.first) <= distance;
  }
  return false;
}
int n;
vector<vector<int>> POSS;
vector<pair<int, int>> P;
bool can(long long mid) {
  union_find un(n);
  for (auto i = (0); i < (n); i++)
    for (auto j = (i + 1); j < (n); j++) {
      if (P[i].first == P[j].first) {
        int distance = abs(P[i].second - P[j].second);
        if (distance <= mid) un.unite(i, j);
      } else if (P[i].second == P[j].second) {
        int distance = abs(P[i].first - P[j].first);
        if (distance <= mid) un.unite(i, j);
      }
    }
  vector<int> ALL(n, 0);
  for (auto i = (0); i < (n); i++) ALL[un.find(i)] = 1;
  int tots = 0;
  for (auto i = (0); i < (n); i++) tots += ALL[i];
  if (tots > 4) {
    return false;
  }
  vector<int> TO(n, 0);
  int cnt = 0;
  for (auto i = (0); i < (n); i++) {
    if (ALL[i] == 1) {
      TO[i] = cnt;
      cnt++;
    }
  }
  if (tots == 1) {
    return true;
  } else {
    bool good = false;
    pair<int, int> pos;
    int have = 0;
    vector<int> D;
    pair<int, int> p1;
    int cnt = 0;
    set<int>::iterator k;
    for (auto i = (0); i < (n); i++) {
      if (good) break;
      for (auto j = (0); j < (n); j++) {
        if (i == j) continue;
        if (good) break;
        if (un.find(i) == un.find(j)) continue;
        if (P[i].first == P[j].first) {
          long long distance = abs(P[i].second - P[j].second);
          if (distance > mid && distance <= mid * 2) {
            if (tots == 2 && un.find(i) != un.find(j)) good = true;
          }
        } else if (P[i].second == P[j].second) {
          long long distance = abs(P[i].first - P[j].first);
          if (distance > mid && distance <= mid * 2) {
            if (tots == 2 && un.find(i) != un.find(j)) good = true;
          }
        } else {
          vector<int> A = POSS[i * n + j];
          if (A.size() < tots) continue;
          p1 = pair<int, int>(P[i].first, P[j].second);
          D = vector<int>(4, 0);
          cnt = 0;
          for (auto z = (0); z < (A.size()); z++)
            if (g(p1, P[A[z]], mid)) D[TO[un.find(A[z])]] = 1;
          for (auto z = (0); z < (4); z++) cnt += D[z];
          if (cnt == tots) good = true;
        }
      }
    }
    if (good) {
      return true;
    } else {
      return false;
    }
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n;
  POSS = vector<vector<int>>(n * n, vector<int>());
  P = vector<pair<int, int>>(n);
  for (auto i = (0); i < (n); i++) cin >> P[i].first >> P[i].second;
  for (auto i = (0); i < (n); i++) {
    X_S[P[i].first].insert(P[i].second);
    NX_S[P[i].first].insert(-P[i].second);
    Y_S[P[i].second].insert(P[i].first);
    NY_S[P[i].second].insert(-P[i].first);
    IND[P[i]] = i;
  }
  pair<int, int> p1;
  set<int>::iterator k;
  for (auto i = (0); i < (n); i++) {
    for (auto j = (0); j < (n); j++) {
      if (i == j) continue;
      p1 = pair<int, int>(P[i].first, P[j].second);
      k = X_S[p1.first].lower_bound(p1.second + 1);
      pair<int, int> pos;
      if (k != X_S[p1.first].end()) {
        pos = pair<int, int>(p1.first, *k);
        POSS[i * n + j].push_back(IND[pos]);
      }
      k = NX_S[p1.first].lower_bound(-(p1.second + 1));
      if (k != NX_S[p1.first].end()) {
        pos = pair<int, int>(p1.first, -*k);
        POSS[i * n + j].push_back(IND[pos]);
      }
      k = Y_S[p1.second].lower_bound(p1.first + 1);
      if (k != Y_S[p1.second].end()) {
        pos = pair<int, int>(*k, p1.second);
        POSS[i * n + j].push_back(IND[pos]);
      }
      k = NY_S[p1.second].lower_bound(-(p1.first + 1));
      if (k != NY_S[p1.second].end()) {
        pos = pair<int, int>(-*k, p1.second);
        POSS[i * n + j].push_back(IND[pos]);
      }
    }
  }
  long long lo = 1, hi = 2 * 1e9;
  int bst = -1;
  if (!can(hi)) {
    cout << -1 << endl;
    return 0;
  }
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    if (can(mid)) {
      hi = mid - 1;
      bst = mid;
    } else {
      lo = mid + 1;
    }
  }
  cout << bst << endl;
}
