#include <bits/stdc++.h>
using namespace std;
template <class T>
T inline sqr(T x) {
  return x * x;
}
template <class T>
inline void relaxMin(T &a, T b) {
  a = min(a, b);
}
template <class T>
inline void relaxMax(T &a, T b) {
  a = max(a, b);
}
string str(int i) {
  char s[100];
  sprintf(s, "%d", i);
  return string(s);
}
inline int sign(int x) { return x > 0 ? 1 : (x < 0 ? -1 : 0); }
inline int myAbs(int a) { return a > 0 ? a : -a; }
const int MOD = (int)1e9 + 7;
const int maxn = 5010;
const int maxd = 10010;
int n, x[maxn], y[maxn];
vector<int> v[maxd];
int p[maxn], si[maxn], col[maxn];
int get(int i) {
  if (i == p[i]) return i;
  int v = get(p[i]);
  if (v != p[i]) {
    assert(p[p[i]] == v);
    col[i] ^= col[p[i]], p[i] = v;
  }
  return v;
}
int color(int i) {
  if (i == p[i]) return col[i];
  return col[i] ^ color(p[i]);
}
void join(int i, int j, int is) {
  assert(i != j);
  if (si[i] > si[j]) swap(i, j);
  si[j] += si[i], p[i] = j;
  assert(col[i] == 0 && col[j] == 0);
  col[i] = is;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); i++) scanf("%d%d", &x[i], &y[i]);
  if (n == 2) {
    printf("0\n2\n");
    return 0;
  }
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(i); j++)
      v[myAbs(x[i] - x[j]) + myAbs(y[i] - y[j])].push_back((i << 15) + j);
  int num = n, res = -1, resd = -1;
  for (int i = 0; i < (int)(maxn); i++) p[i] = i, si[i] = 1, col[i] = 0;
  for (int d = (int)(maxd)-1; d >= 0; d--) {
    res = num;
    int bad = 0;
    for (int t = 0; t < (int)((int)(v[d]).size()); t++) {
      int i = v[d][t] >> 15;
      int j = v[d][t] & ((1 << 15) - 1);
      if (get(i) == get(j)) {
        if (color(i) == color(j)) bad = 1;
      } else {
        num--;
        join(get(i), get(j), color(i) == color(j));
      }
    }
    if (bad) {
      resd = d;
      break;
    }
  }
  int ans = 1;
  for (int i = 0; i < (int)(res); i++) ans = (ans * 2) % MOD;
  printf("%d\n%d\n", resd, ans);
  return 0;
}
