#include <bits/stdc++.h>
using namespace std;
const int maxn = 5001, mo = 1000000007;
struct both {
  int x, y;
};
vector<both> D[maxn * 2];
int n, ans, res;
int X[maxn], Y[maxn];
int f[maxn], g[maxn];
long long mul(long long a, long long b) {
  long long c = 1;
  while (b) {
    if (b & 1) c = c * a % mo;
    b >>= 1;
    a = a * a % mo;
  }
  return c;
}
int find(int x) {
  if (f[x] == x) return x;
  int y = f[x];
  f[x] = find(f[x]);
  g[x] ^= g[y];
  return f[x];
}
int main() {
  int i, j, x, y, col;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) f[i] = i, g[i] = 0;
  for (i = 1; i <= n; ++i) scanf("%d%d", &X[i], &Y[i]);
  for (i = 1; i <= n; ++i)
    for (j = i + 1; j <= n; ++j)
      D[abs(X[i] - X[j]) + abs(Y[i] - Y[j])].push_back((both){i, j});
  res = n;
  for (ans = maxn * 2 - 2; ans; --ans) {
    col = res;
    for (i = 0; i < (int)D[ans].size(); ++i) {
      x = find(D[ans][i].x), y = find(D[ans][i].y);
      if (x != y)
        f[x] = y, g[x] ^= (g[D[ans][i].x] == g[D[ans][i].y]), --res;
      else if (g[D[ans][i].x] == g[D[ans][i].y]) {
        printf("%d\n%d", ans, mul(2, col));
        return 0;
      }
    }
  }
  printf("%d\n%d", ans, mul(2, res));
  return 0;
}
