#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n;
int xx[5005], yy[5005];
int dis;
int col[5005];
bool flag;
void dfs(int x, int k) {
  col[x] = k;
  for (int i = 1; i <= n; i++) {
    if (!flag) return;
    if (abs(xx[x] - xx[i]) + abs(yy[x] - yy[i]) > dis) {
      if (!col[i]) {
        dfs(i, 3 - k);
      } else if (col[i] == col[x]) {
        flag = 0;
        return;
      }
    }
  }
}
int pd(int x) {
  int num = 0;
  dis = x;
  flag = 1;
  memset(col, 0, sizeof(col));
  for (int i = 1; i <= n; i++) {
    if (!col[i]) {
      dfs(i, 1);
      num++;
      if (!flag) return 0;
    }
  }
  return num;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &xx[i], &yy[i]);
  }
  int l = 0, r = 10000;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (pd(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  long long ans = 1;
  for (int i = pd(l); i; i--) {
    ans = ans * 2 % mod;
  }
  printf("%d\n", l);
  printf("%lld", ans);
  return 0;
}
