#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 5005;
const long long mod = 1e9 + 7;
inline long long read() {
  long long weight = 0, symbol = 1;
  char in = getchar();
  while (!isdigit(in)) {
    if (in == '-') symbol = -1;
    in = getchar();
  }
  while (isdigit(in)) {
    weight = weight * 10 + in - '0';
    in = getchar();
  }
  return symbol * weight;
}
long long Fpow(long long x, long long y) {
  if (!y) return 1;
  long long res = 1;
  while (y) {
    if (y & 1) {
      res = (res * x) % mod;
      y--;
    } else {
      x = (x * x) % mod;
      y >>= 1;
    }
  }
  return res;
}
long long n;
long long ans, num;
struct point {
  long long x, y;
} pt[MAXN];
long long get_dis(long long a, long long b) {
  return abs(pt[a].x - pt[b].x) + abs(pt[a].y - pt[b].y);
}
long long cnt;
long long col[MAXN];
bool dfs(long long x, long long dis) {
  for (long long i = 1; i <= n; i++) {
    if (x == i || get_dis(x, i) <= dis) continue;
    if (col[i] == -1) {
      col[i] = !col[x];
      if (!dfs(i, dis)) return 0;
    } else if (col[x] == col[i])
      return 0;
  }
  return 1;
}
bool check(long long mid) {
  cnt = 0;
  memset(col, -1, sizeof(col));
  for (long long i = 1; i <= n; i++) {
    if (col[i] != -1) continue;
    cnt++;
    if (!dfs(i, mid)) return 0;
  }
  num = cnt, ans = mid;
  return 1;
}
signed main() {
  n = read();
  for (long long i = 1; i <= n; i++) pt[i].x = read(), pt[i].y = read();
  long long le = 0, ri = 10000;
  while (le <= ri) {
    long long mid = (le + ri) >> 1;
    if (check(mid))
      ri = mid - 1;
    else
      le = mid + 1;
  }
  num = Fpow(2, num);
  printf("%lld\n%lld\n", ans, num);
  return 0;
}
