#include <bits/stdc++.h>
using namespace std;
const int MAX = 5050;
const int MOD = 1000000007;
int n;
int x[MAX], y[MAX];
int color[MAX];
int abs(int a) { return a < 0 ? -a : a; }
bool dfs(int s, int mx) {
  for (int i = 0; i < n; ++i) {
    if (abs(x[s] - x[i]) + abs(y[s] - y[i]) <= mx) continue;
    if (color[i] == color[s]) return false;
    if (color[i] == -1) {
      color[i] = color[s] ^ 1;
      if (!dfs(i, mx)) return false;
    }
  }
  return true;
}
int getcnt(int mx) {
  int ans = 1;
  memset(color, -1, sizeof(color));
  for (int i = 0; i < n; ++i)
    if (color[i] == -1) {
      color[i] = 0;
      if (!dfs(i, mx)) return 0;
      ans = (ans << 1) % MOD;
    }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i] >> y[i];
  int ll = -1, rr = 10000;
  while (ll + 1 < rr) {
    int m = (ll + rr) / 2;
    if (getcnt(m))
      rr = m;
    else
      ll = m;
  }
  cout << rr << '\n' << getcnt(rr) << '\n';
  return 0;
}
