#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > qraf;
vector<int> w;
void dfs(int v, int c) {
  w[v] = c;
  for (auto &z : qraf[v]) {
    if (!w[z]) {
      dfs(z, c);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int test = 1;
  for (int testing = 0; testing < test; testing++) {
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for (int i = 0; i < n; i++) {
      cin >> x[i] >> y[i];
    }
    map<int, vector<pair<int, int> > > tx, ty;
    for (int i = 0; i < n; i++) {
      tx[x[i]].emplace_back(y[i], i);
      ty[y[i]].emplace_back(x[i], i);
    }
    for (auto &u : tx) sort(u.second.begin(), u.second.end());
    for (auto &u : ty) sort(u.second.begin(), u.second.end());
    long long l = -1, r = 2000000007;
    while (r > 1 + l) {
      long long mid = (l + r) / 2;
      qraf.clear();
      qraf.resize(n);
      for (auto &u : tx) {
        for (int i = 1; i < (int)u.second.size(); i++) {
          if (u.second[i].first - u.second[i - 1].first <= mid) {
            qraf[u.second[i].second].emplace_back(u.second[i - 1].second);
            qraf[u.second[i - 1].second].emplace_back(u.second[i].second);
          }
        }
      }
      for (auto &u : ty) {
        for (int i = 1; i < (int)u.second.size(); i++) {
          if (u.second[i].first - u.second[i - 1].first <= mid) {
            qraf[u.second[i].second].emplace_back(u.second[i - 1].second);
            qraf[u.second[i - 1].second].emplace_back(u.second[i].second);
          }
        }
      }
      int count = 1;
      w.assign(n, 0);
      for (int i = 0; i < n; i++) {
        if (w[i]) {
          continue;
        }
        dfs(i, count);
        count++;
      }
      count--;
      if (count > 4) {
        l = mid;
        continue;
      }
      bool flag = false;
      if (count == 1) {
        flag = true;
      } else if (count == 2) {
        for (int i = 0; i < n; i++) {
          for (int j = i + 1; j < n; j++) {
            if (w[i] == w[j]) {
              continue;
            }
            if ((x[i] == x[j] && abs(y[i] - y[j]) <= 2 * mid) ||
                (y[i] == y[j] && abs(x[i] - x[j]) <= 2 * mid) ||
                (abs(x[i] - x[j]) <= mid && abs(y[i] - y[j]) <= mid)) {
              flag = true;
            }
          }
        }
      } else if (count == 3) {
        vector<pair<int, int> > asxy;
        for (auto &u : tx) {
          for (int i = 1; i < (int)u.second.size(); i++) {
            if (w[u.second[i].second] != w[u.second[i - 1].second]) {
              asxy.emplace_back(u.second[i].second, u.second[i - 1].second);
            }
          }
        }
        for (auto &u : ty) {
          for (int i = 1; i < (int)u.second.size(); i++) {
            if (w[u.second[i].second] != w[u.second[i - 1].second]) {
              asxy.emplace_back(u.second[i].second, u.second[i - 1].second);
            }
          }
        }
        for (auto &u : asxy) {
          int i = u.first, j = u.second;
          for (int o = 0; o < n; o++) {
            if (w[o] == w[i] || w[o] == w[j]) {
              continue;
            }
            if (x[i] == x[j]) {
              if (min(y[i], y[j]) >= y[o] || max(y[i], y[j]) <= y[o] ||
                  abs(x[i] - x[o]) > mid)
                continue;
              if (abs(y[i] - y[o]) <= mid && abs(y[j] - y[o]) <= mid)
                flag = true;
            } else {
              if (min(x[i], x[j]) >= x[o] || max(x[i], x[j]) <= x[o] ||
                  abs(y[i] - y[o]) > mid) {
                continue;
              }
              if (abs(x[i] - x[o]) <= mid && abs(x[j] - x[o]) <= mid) {
                flag = true;
              }
            }
          }
        }
      } else {
        vector<pair<int, int> > asx, asy;
        for (auto &u : tx) {
          for (int i = 1; i < (int)u.second.size(); i++) {
            if (w[u.second[i].second] != w[u.second[i - 1].second]) {
              asx.emplace_back(u.second[i].second, u.second[i - 1].second);
            }
          }
        }
        for (auto &u : ty) {
          for (int i = 1; i < (int)u.second.size(); i++) {
            if (w[u.second[i].second] != w[u.second[i - 1].second]) {
              asy.emplace_back(u.second[i].second, u.second[i - 1].second);
            }
          }
        }
        for (auto &u : asx) {
          for (auto &u1 : asy) {
            int i = u.first, o = u1.first, k = u1.second, j = u.second;
            if (w[i] == w[o] || w[i] == w[k] || w[j] == w[k] || w[j] == w[o] ||
                min(y[i], y[j]) >= y[o] || max(y[i], y[j]) <= y[o] ||
                min(x[o], x[k]) >= x[i] || max(x[o], x[k]) <= x[i]) {
              continue;
            }
            if (abs(y[i] - y[o]) <= mid && abs(y[j] - y[o]) <= mid &&
                abs(x[k] - x[i]) <= mid && abs(x[o] - x[i]) <= mid) {
              flag = true;
            }
          }
        }
      }
      if (flag) {
        r = mid;
      } else {
        l = mid;
      }
    }
    if (r == 2000000007) {
      cout << "-1\n";
    } else {
      cout << r << "\n";
    }
  }
  return 0;
}
