#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 10, N = 5010, mod = 1e9 + 7;
long long n, ans, k, t, a[N], b[N];
pair<long long, long long> A[N];
bool mark[N], c[N];
long long dis(long long x, long long y) {
  return abs(a[x] - a[y]) + abs(b[x] - b[y]);
}
bool dfs(long long v, long long C, long long d) {
  c[v] = C;
  mark[v] = true;
  for (long long i = 0; i < n; i++) {
    if (i == v || dis(v, i) <= d) continue;
    if ((mark[i] && c[i] == C) || !mark[i] && !dfs(i, 1 - C, d)) return false;
  }
  return true;
}
long long check(long long x) {
  memset(c, 0, sizeof c);
  memset(mark, 0, sizeof mark);
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (!mark[i]) {
      if (!dfs(i, 1, x)) return 0;
      ans++;
    }
  }
  return ans;
}
long long power(long long a, long long b) {
  long long ans = 1;
  for (; b; b /= 2) {
    if (b % 2) ans *= a, ans %= mod;
    a *= a, a %= mod;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i] >> b[i];
  long long l = -1, r = 10000;
  while (1 < r - l) {
    long long mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << r << '\n';
  cout << power(2, check(r)) << '\n';
  return 0;
}
