#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1007, MAXM = 1e6 + 7;
int n;
struct node {
  int x, y;
} N1[MAXN], N2[MAXM * 2], N3[MAXM * 2];
bool cmp(const node &A, const node &B) {
  return A.x == B.x ? A.y < B.y : A.x < B.x;
}
int cntn2, cntn3;
map<pair<int, int>, int> num;
int num2[MAXN][MAXN][2];
long long L, R, mid;
int Map[MAXM * 2][5];
int Map2[MAXN];
int dsu[MAXN];
int cnt[MAXM];
int arr[MAXN];
int find(int A) { return A == dsu[A] ? A : dsu[A] = find(dsu[A]); }
inline bool check() {
  for (int i = 1; i <= n; i++) {
    dsu[i] = i;
    arr[i] = 0;
    Map2[i] = 0;
  }
  for (register int i = 1, i2, i3; i <= n; i++)
    for (register int j = i + 1; j <= n; j++)
      if (N1[i].x == N1[j].x || N1[i].y == N1[j].y) {
        if (abs(N1[i].x - N1[j].x) + abs(N1[i].y - N1[j].y) > mid) continue;
        i2 = find(i);
        i3 = find(j);
        dsu[i2] = i3;
      }
  for (int i = 1; i <= cntn3; i++) {
    Map[i][4] = Map[i][1] = Map[i][2] = Map[i][3] = 0;
    cnt[i] = 0;
  }
  int all = 0;
  for (int i = 1; i <= n; i++) {
    if (!arr[find(i)]) {
      arr[find(i)] = 1;
      all++;
      if (all > 4) return 0;
      Map2[find(i)] = all;
    }
  }
  if (all == 1) return 1;
  for (register int i = 1, now, i2, i3; i <= n; i++) {
    for (register int j = i + 1; j <= n; j++) {
      i2 = find(i);
      i3 = find(j);
      i2 = Map2[i2];
      i3 = Map2[i3];
      if (i2 == i3) continue;
      if (N1[i].x != N1[j].x && N1[i].y != N1[j].y) {
        now = num2[i][j][0];
        if (abs(N1[i].y - N1[j].y) <= mid) {
          if (!Map[now][i2]) {
            Map[now][i2] = 1;
            cnt[now]++;
          }
        }
        if (abs(N1[i].x - N1[j].x) <= mid) {
          if (!Map[now][i3]) {
            Map[now][i3] = 1;
            cnt[now]++;
          }
        }
        now = num2[i][j][1];
        if (abs(N1[i].y - N1[j].y) <= mid) {
          if (!Map[now][i3]) {
            Map[now][i3] = 1;
            cnt[now]++;
          }
        }
        if (abs(N1[i].x - N1[j].x) <= mid) {
          if (!Map[now][i2]) {
            Map[now][i2] = 1;
            cnt[now]++;
          }
        }
      }
      if (N1[i].x == N1[j].x) {
        now = num2[i][j][0];
        if (abs(N1[i].y - ((N1[i].y + N1[j].y) >> 1)) <= mid) {
          if (!Map[now][i2]) {
            Map[now][i2] = 1;
            cnt[now]++;
          }
        }
        if (abs(N1[j].y - ((N1[i].y + N1[j].y) >> 1)) <= mid) {
          if (!Map[now][i3]) {
            Map[now][i3] = 1;
            cnt[now]++;
          }
        }
        now = num2[i][j][1];
        if (abs(N1[i].y - ((N1[i].y + N1[j].y) >> 1) - 1) <= mid) {
          if (!Map[now][i2]) {
            Map[now][i2] = 1;
            cnt[now]++;
          }
        }
        if (abs(N1[j].y - ((N1[i].y + N1[j].y) >> 1) - 1) <= mid) {
          if (!Map[now][i3]) {
            Map[now][i3] = 1;
            cnt[now]++;
          }
        }
      }
      if (N1[i].y == N1[j].y) {
        now = num2[i][j][0];
        if (abs(N1[i].x - ((N1[i].x + N1[j].x) >> 1)) <= mid) {
          if (!Map[now][i2]) {
            Map[now][i2] = 1;
            cnt[now]++;
          }
        }
        if (abs(N1[j].x - ((N1[i].x + N1[j].x) >> 1)) <= mid) {
          if (!Map[now][i3]) {
            Map[now][i3] = 1;
            cnt[now]++;
          }
        }
        now = num2[i][j][1];
        if (abs(N1[i].x - ((N1[i].x + N1[j].x) >> 1) - 1) <= mid) {
          if (!Map[now][i2]) {
            Map[now][i2] = 1;
            cnt[now]++;
          }
        }
        if (abs(N1[j].x - ((N1[i].x + N1[j].x) >> 1) - 1) <= mid) {
          if (!Map[now][i3]) {
            Map[now][i3] = 1;
            cnt[now]++;
          }
        }
      }
    }
  }
  for (int i = 1; i <= cntn3; i++) {
    if (cnt[i] == all) return 1;
  }
  return 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> N1[i].x >> N1[i].y;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (N1[i].x != N1[j].x && N1[i].y != N1[j].y) {
        N2[++cntn2].x = N1[i].x;
        N2[cntn2].y = N1[j].y;
        N2[++cntn2].x = N1[j].x;
        N2[cntn2].y = N1[i].y;
      }
      if (N1[i].x == N1[j].x) {
        N2[++cntn2].x = N1[i].x;
        N2[cntn2].y = (N1[i].y + N1[j].y) >> 1;
        N2[++cntn2].x = N1[i].x;
        N2[cntn2].y = ((N1[i].y + N1[j].y) >> 1) + 1;
      }
      if (N1[i].y == N1[j].y) {
        N2[++cntn2].y = N1[i].y;
        N2[cntn2].x = (N1[i].x + N1[j].x) >> 1;
        N2[++cntn2].y = N1[i].y;
        N2[cntn2].x = ((N1[i].x + N1[j].x) >> 1) + 1;
      }
    }
  }
  sort(N2 + 1, N2 + 1 + cntn2, cmp);
  N3[++cntn3] = N2[1];
  for (int i = 2; i <= cntn2; i++)
    if (N2[i].x != N2[i - 1].x || N2[i].y != N2[i - 1].y) {
      N3[++cntn3] = N2[i];
      num[make_pair(N2[i].x, N2[i].y)] = cntn3;
    }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (N1[i].x != N1[j].x && N1[i].y != N1[j].y) {
        num2[i][j][0] = num[make_pair(N1[i].x, N1[j].y)];
        num2[i][j][1] = num[make_pair(N1[j].x, N1[i].y)];
      }
      if (N1[i].x == N1[j].x) {
        num2[i][j][0] = num[make_pair(N1[i].x, (N1[i].y + N1[j].y) >> 1)];
        num2[i][j][1] = num[make_pair(N1[i].x, ((N1[i].y + N1[j].y) >> 1) + 1)];
      }
      if (N1[i].y == N1[j].y) {
        num2[i][j][0] = num[make_pair((N1[i].x + N1[j].x) >> 1, N1[i].y)];
        num2[i][j][1] = num[make_pair(((N1[i].x + N1[j].x) >> 1) + 1, N1[i].y)];
      }
    }
  }
  L = 0;
  R = 2e9 + 1e5;
  int can = 0;
  while (L + 1 < R) {
    mid = (L + R) / 2ll;
    can = check();
    if (can)
      R = mid;
    else
      L = mid;
  }
  if (R <= 2e9)
    cout << R;
  else
    cout << -1;
}
