#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 10, rem = 1e9 + 7;
vector<pair<int, int> > vec;
int n, com, t[maxn];
bool b, mark[maxn];
void input() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    vec.push_back({a, b});
  }
}
void dfs(int v, int par, int k) {
  mark[v] = true;
  for (int i = 0; i < n; i++) {
    int x = abs(vec[i].first - vec[v].first),
        y = abs(vec[i].second - vec[v].second);
    if (i != v && x + y > k) {
      if (!mark[i])
        t[i] = t[v] ^ 1, dfs(i, v, k);
      else if (i != par && t[i] != t[v] ^ 1)
        b = false;
    }
  }
}
void init() {
  for (int i = 0; i < n; i++) mark[i] = false, t[i] = 0;
  b = true;
}
bool valid(int k) {
  init();
  com = 0;
  for (int i = 0; i < n; i++)
    if (!mark[i]) dfs(i, i, k), com++;
  if (b) return true;
  return false;
}
int main() {
  input();
  if (n == 2) {
    cout << 0 << endl << 2 << endl;
    return 0;
  }
  int l = 0, r = 2e9;
  while (r - l > 1) {
    int mid = (r + l) / 2;
    if (valid(mid))
      r = mid;
    else
      l = mid;
  }
  valid(l + 1);
  cout << l + 1 << endl;
  long long ans = 1;
  while (com--) ans *= 2, ans %= rem;
  cout << ans << endl;
}
