#include <bits/stdc++.h>
using namespace std;
const int max_N = 5000 + 10;
const int mod = 1e9 + 7;
vector<int> adj[max_N];
int n, x[max_N], y[max_N], col[max_N];
bool dfs(int v) {
  for (int u : adj[v]) {
    if (!col[u]) {
      col[u] = 3 - col[v];
      if (!dfs(u)) return false;
    } else if (col[u] == col[v])
      return false;
  }
  return true;
}
int check(int k) {
  for (int i = 0; i < n; i++) adj[i].clear(), col[i] = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int d = abs(x[i] - x[j]) + abs(y[i] - y[j]);
      if (d > k) adj[i].push_back(j), adj[j].push_back(i);
    }
  int comp(0);
  for (int i = 0; i < n; i++)
    if (!col[i]) {
      comp++;
      col[i] = 1;
      if (!dfs(i)) return -1;
    }
  return comp;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  int st = 0, en = 2 * max_N, c;
  while (en - st > 1) {
    int mid = (st + en) / 2;
    c = check(mid);
    if (c == -1)
      st = mid;
    else
      en = mid;
  }
  c = check(st);
  if (c == -1) {
    st = en;
    c = check(st);
  }
  int cnt(1);
  while (c--) cnt = (cnt * 2) % mod;
  cout << st << "\n" << cnt << "\n";
  return 0;
}
