#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 1, P = 1e9 + 7;
int n, x[N], y[N], mark[N];
vector<int> adj[N];
bool dfs(int u, int d) {
  bool res = 1;
  for (int v = 0; v < n; v++)
    if (abs(x[u] - x[v]) + abs(y[u] - y[v]) > d)
      if (mark[v] == mark[u])
        res = 0;
      else if (!mark[v]) {
        mark[v] = 3 - mark[u];
        res &= dfs(v, d);
      }
  return res;
}
int calc(int mid) {
  int res = 1;
  memset(mark, 0, sizeof mark);
  for (int u = 0; u < n; u++)
    if (!mark[u]) {
      mark[u] = 1;
      res = res * 2 * dfs(u, mid) % P;
    }
  return res;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  int l = -1, r = 2 * N;
  while (r - l > 1) {
    int mid = l + r >> 1;
    (calc(mid) ? r : l) = mid;
  }
  cout << r << endl << calc(r) << endl;
}
