#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3 + 3;
const int MOD = 1e9 + 7;
const int INF = 1e4;
const int LOG = 3e3;
int n, h[MAXN], ans, X;
pair<int, int> p[MAXN];
int vis[MAXN];
bool ok;
int mul(int a, int b) { return 1ll * a * b % MOD; }
int pwr(int a, int b) {
  if (!b) {
    return 1;
  }
  int tmp = pwr(a, b / 2);
  tmp = mul(tmp, tmp);
  if (b & 1) {
    tmp = mul(tmp, a);
  }
  return tmp;
}
void dfs(int u, int par, int c) {
  vis[u] = c;
  for (int i = 1; i <= n; i++) {
    if (i != u) {
      if (!vis[i] &&
          abs(p[u].first - p[i].first) + abs(p[u].second - p[i].second) > X) {
        h[i] = h[u] + 1;
        dfs(i, u, c);
      } else if (vis[i] == vis[u] && i != par && (h[i] & 1) == (h[u] & 1) &&
                 abs(p[u].first - p[i].first) + abs(p[u].second - p[i].second) >
                     X) {
        ok = false;
      }
    }
  }
}
bool Check(int x) {
  memset(vis, 0, sizeof vis);
  memset(h, 0, sizeof h);
  X = x;
  int cnt = 0;
  ok = true;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      dfs(i, 0, cnt + 1);
      cnt++;
    }
  }
  if (!ok) {
    return false;
  }
  ans = pwr(2, cnt);
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  int l = -1, r = INF;
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    if (Check(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << r << "\n" << ans;
  return 0;
}
