#include <bits/stdc++.h>
using namespace std;
int n;
int x[5000], y[5000];
int color[5000];
bool bad;
int blocks, lim;
void DFS(int u) {
  if (bad) return;
  for (int v = 0; v < n; v++)
    if ((abs(x[u] - x[v]) + abs(y[u] - y[v])) > lim) {
      if (color[v] == -1) {
        color[v] = 1 - color[u];
        DFS(v);
      } else {
        if (color[v] + color[u] != 1) bad = true;
      }
    }
}
bool Check(int lim) {
  ::lim = lim;
  bad = false;
  memset(color, -1, sizeof(color));
  blocks = 0;
  for (int i = 0; i < n; i++)
    if (color[i] == -1) {
      blocks++;
      color[i] = 0;
      DFS(i);
      if (bad) return false;
    }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", x + i, y + i);
  int lo = 0, hi = 10000;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (Check(mid))
      hi = mid - 1;
    else
      lo = mid + 1;
  }
  printf("%d\n", lo);
  Check(lo);
  int ans = 1;
  for (int i = 0; i < blocks; i++) ans = ans * 2 % 1000000007;
  printf("%d\n", ans);
  return 0;
}
