#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
const long long int Maxn = 5e3 + 5, N = 1e6 + 5, Mod = 1e9 + 7, Inf = 2e4 + 5,
                    Log = 22;
struct Tower {
  int x, y;
} t[Maxn];
int n;
bool mrk[Maxn], col[Maxn], cur, ans;
long long int Power(long long int x, long long int t) {
  if (t == 0) return 1;
  return ((t % 2 ? x : 1) * Power((x * x) % Mod, t / 2)) % Mod;
}
void Clear() {
  for (int i = 1; i <= n; i++) {
    col[i] = 0;
    mrk[i] = 0;
  }
  return;
}
void Dfs(int v, int m) {
  if (!cur) {
    return;
  }
  mrk[v] = 1;
  for (int u = 1; u <= n; u++) {
    int dis = abs(t[v].x - t[u].x) + abs(t[v].y - t[u].y);
    if (m < dis) {
      if (!mrk[u]) {
        col[u] = 1 - col[v];
        Dfs(u, m);
      }
      if (col[u] == col[v]) {
        cur = 0;
      }
    }
  }
  return;
}
int Dfs_All(int m) {
  int cnt = 0;
  cur = 1;
  for (int i = 1; i <= n; i++) {
    if (!mrk[i]) {
      cnt++;
      Dfs(i, m);
    }
    if (!cur) break;
  }
  return cnt;
}
bool Ok(int m) {
  cur = 1;
  Dfs_All(m);
  Clear();
  return cur;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> t[i].x >> t[i].y;
  }
  int l = -1, r = Inf;
  while (l + 1 < r) {
    int m = (l + r) / 2;
    if (Ok(m)) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << r << '\n' << Power(2, Dfs_All(r));
  return 0;
}
