#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[5005];
const int mod = 1e9 + 7;
inline int read() {
  char c = getchar();
  int fh = 0;
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) fh = (fh << 1) + (fh << 3) + (c ^ 48), c = getchar();
  return fh;
}
inline int qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % mod;
    b >>= 1;
    a = 1ll * a * a % mod;
  }
  return ans;
}
int ans, num, n, col[5005];
inline int abs(int a) { return a >= 0 ? a : -a; }
inline int dis(int i, int u) {
  return abs(a[i].first - a[u].first) + abs(a[i].second - a[u].second);
}
bool dfs(int u, int len) {
  for (int v = 1; v <= n; ++v) {
    if (u == v || dis(u, v) <= len) continue;
    if (col[v] == -1) {
      col[v] = !col[u];
      if (!dfs(v, len)) return 0;
    } else if (col[v] == col[u])
      return 0;
  }
  return 1;
}
bool check(int len) {
  for (int i = 1; i <= n; ++i) col[i] = -1;
  int cnt = 0;
  for (int i = 1; i <= n; ++i)
    if (col[i] == -1) {
      ++cnt;
      if (!dfs(i, len)) return 0;
    }
  ans = len, num = cnt;
  return 1;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i].first = read(), a[i].second = read();
  int l = 0, r = 1e4, mid;
  while (l <= r) {
    mid = l + r >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  printf("%d", qpow(2, num));
}
