#include <bits/stdc++.h>
using namespace std;
long long Abs(long long x) { return x > 0 ? x : -x; }
long long n, cnt;
long long x[5005], y[5005], belong[5005];
bool vis[5005];
long long calc(long long i, long long j) {
  return Abs(x[i] - x[j]) + Abs(y[i] - y[j]);
}
void read(long long &x) {
  x = 0;
  char c = getchar();
  long long f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  x *= f;
  return;
}
void write(long long x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
bool dfs(long long x, long long mid) {
  vis[x] = 1;
  for (register long long i = 1; i <= n; ++i) {
    if (calc(x, i) <= mid || i == x) continue;
    if (vis[i]) {
      if (belong[x] == belong[i]) return 1;
      continue;
    }
    belong[i] = !belong[x];
    if (dfs(i, mid)) return 1;
  }
  return 0;
}
bool pd(long long mid) {
  cnt = 0;
  memset(vis, 0, sizeof(vis));
  for (register long long i = 1; i <= n; ++i)
    if (!vis[i]) {
      if (dfs(i, mid)) return 0;
      cnt++;
    }
  return 1;
}
long long quick_pow(long long a, long long b, long long c) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % c;
    a = a * a % c;
    b >>= 1;
  }
  return res % c;
}
signed main() {
  read(n);
  for (register long long i = 1; i <= n; ++i) read(x[i]), read(y[i]);
  long long l = 0, r = 10000, ans = 0, num = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (pd(mid))
      ans = mid, num = cnt, r = mid - 1;
    else
      l = mid + 1;
  }
  write(ans), putchar('\n'), write(quick_pow(2, num, 1000000007)),
      putchar('\n');
  return 0;
}
