#include <bits/stdc++.h>
using namespace std;
int const maxn = 5003;
long long const mod = 1000000007;
int n = 0;
int x[maxn], y[maxn];
inline int distance(int a, int b) {
  return abs(a[x] - b[x]) + abs(y[a] - y[b]);
}
int color[maxn], V = 0;
bool dfs(int x, int f) {
  color[x] = (color[f] == 1 ? 2 : 1);
  for (int i = 1; i <= n; ++i)
    if (distance(x, i) > V) {
      if (color[i] == 0) {
        if (!dfs(i, x)) return false;
      } else if (color[i] + color[x] != 3)
        return false;
    }
  return true;
}
int check() {
  memset(color, 0, sizeof color);
  color[0] = 1;
  int cntCC = 0;
  for (int i = 1; i <= n; ++i)
    if (color[i] == 0) {
      ++cntCC;
      if (!dfs(i, 0)) return -1;
    }
  return cntCC;
}
long long pow2(long long b) {
  long long r = 1, x = 2;
  while (b) {
    if (b & 1) r = r * x % mod;
    x = x * x % mod;
    b >>= 1;
  }
  return r;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d %d", x + i, y + i);
  int L = 0, R = 10000;
  int ans = 0;
  while (L <= R) {
    V = (L + R) >> 1;
    int k = check();
    if (k < 0)
      L = V + 1;
    else {
      R = V - 1;
      ans = k;
    }
  }
  printf("%d\n%lld\n", R + 1, pow2(ans));
  return 0;
}
