There are n detachments on the surface, numbered from 1 to n, the i-th detachment is placed in a point with coordinates (x_i, y_i). All detachments are placed in different points.

Brimstone should visit each detachment at least once. You can choose the detachment where Brimstone starts.

To move from one detachment to another he should first choose one of four directions of movement (up, right, left or down) and then start moving with the constant speed of one unit interval in a second until he comes to a detachment. After he reaches an arbitrary detachment, he can repeat the same process.

Each t seconds an orbital strike covers the whole surface, so at that moment Brimstone should be in a point where some detachment is located. He can stay with any detachment as long as needed.

Brimstone is a good commander, that's why he can create at most one detachment and place it in any empty point with integer coordinates he wants before his trip. Keep in mind that Brimstone will need to visit this detachment, too.

Help Brimstone and find such minimal t that it is possible to check each detachment. If there is no such t report about it.

Input

The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of detachments.

In each of the next n lines there is a pair of integers x_i, y_i (|x_i|, |y_i| ≤ 10^9) — the coordinates of i-th detachment.

It is guaranteed that all points are different.

Output

Output such minimal integer t that it is possible to check all the detachments adding at most one new detachment.

If there is no such t, print -1.

Examples

Input


4
100 0
0 100
-100 0
0 -100


Output


100

Input


7
0 2
1 0
-3 0
0 -2
-1 -1
-1 -3
-2 -3


Output


-1

Input


5
0 0
0 -1
3 0
-2 0
-2 1


Output


2

Input


5
0 0
2 0
0 -1
-2 0
-2 1


Output


2

Note

In the first test it is possible to place a detachment in (0, 0), so that it is possible to check all the detachments for t = 100. It can be proven that it is impossible to check all detachments for t < 100; thus the answer is 100.

In the second test, there is no such t that it is possible to check all detachments, even with adding at most one new detachment, so the answer is -1.

In the third test, it is possible to place a detachment in (1, 0), so that Brimstone can check all the detachments for t = 2. It can be proven that it is the minimal such t.

In the fourth test, there is no need to add any detachments, because the answer will not get better (t = 2). It can be proven that it is the minimal such t.
#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;
}
