#include <bits/stdc++.h>
using namespace std;
const int maxn = 5003;
const int mo = 1e9 + 7;
int n, d[maxn][maxn], fa[maxn], col[maxn], mid;
pair<int, int> po[maxn];
bool dfs(int u) {
  int to;
  for (int i = 1; i <= n; ++i) {
    if (d[u][i] > mid)
      to = i;
    else
      continue;
    if (col[to] == col[u]) return false;
    if (!col[to]) {
      col[to] = col[u] ^ 3;
      if (!dfs(to)) return false;
    }
  }
  return true;
}
int fnd(int x) { return fa[x] == x ? x : fa[x] = fnd(fa[x]); }
void merge(int x, int y) {
  int fu = fnd(x), fv = fnd(y);
  if (fu != fv) fa[fu] = fv;
}
int check() {
  for (int i = 1; i <= n; ++i) fa[i] = i, col[i] = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (d[i][j] > mid) {
        if (d[i][j] > mid) merge(i, j);
      }
  for (int i = 1; i <= n; ++i)
    if (!col[i]) {
      col[i] = 1;
      if (!dfs(i)) return 0;
    }
  int res = 0;
  for (int i = 1; i <= n; ++i)
    if (fnd(i) == i) ++res;
  return res;
}
int qpow(int x, int p) {
  int rt = 1;
  while (p) {
    if (p & 1) rt = (1ll * rt * x) % mo;
    x = (1ll * x * x) % mo;
    p >>= 1;
  }
  return rt;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d%d", &po[i].first, &po[i].second);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j)
      d[i][j] =
          abs(po[i].first - po[j].first) + abs(po[i].second - po[j].second);
  }
  int l = -1, r = 10001, res, ans = 10000;
  while (l < r - 1) {
    mid = (l + r) / 2;
    res = check();
    if (!res)
      l = mid;
    else
      r = mid, ans = res;
  }
  printf("%d\n", r);
  printf("%d\n", qpow(2, ans));
  return 0;
}
