#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
} p[5001];
int mau[5001];
int n, soCach;
int pow(int a, int b) {
  if (b == 0) return 1;
  if (b % 2 == 1) return (a * pow(a, b - 1)) % 1000000007;
  long long ans = pow(a, b / 2);
  return (ans * ans) % 1000000007;
}
bool dfs(int i, int g) {
  bool ans = true;
  for (int j = 0; j < n; j++)
    if (abs(p[i].x - p[j].x) + abs(p[i].y - p[j].y) > g) {
      if (mau[j] == mau[i]) return false;
      if (mau[j] == -1) {
        mau[j] = mau[i] ^ 1;
        ans &= dfs(j, g);
      }
    }
  return ans;
}
bool ok(int g) {
  memset(mau, -1, sizeof(mau));
  int comp = 0;
  bool ans = true;
  for (int i = 0; i < n; i++)
    if (mau[i] == -1) {
      comp++;
      mau[i] = 0;
      ans &= dfs(i, g);
    }
  if (ans) soCach = pow(2, comp);
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &p[i].x, &p[i].y);
  int l = -1, r = 10000;
  while (l + 1 < r) {
    int g = (l + r) >> 1;
    if (ok(g))
      r = g;
    else
      l = g;
  }
  printf("%d\n", r);
  printf("%d\n", soCach);
}
