#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1e9 + 7;
constexpr int N = 5010;
int n, color[N], mark[N], x[N], y[N], val, dis[N][N];
bool cant;
long long mypow(long long a, long long b) {
  return b ? (mypow(a * a % MOD, b >> 1) * (b & 1 ? a : 1)) % MOD : 1;
}
void dfs(int v, int col) {
  color[v] = col;
  mark[v] = 1;
  for (int i = 0; i < n; i++) {
    if (dis[v][i] > val) {
      if (!mark[i])
        dfs(i, 3 - col);
      else if (color[v] == color[i])
        cant = true;
    }
  }
}
bool check() {
  cant = false;
  memset(mark, 0, sizeof(mark));
  for (int i = 0; i < n; i++)
    if (!mark[i]) dfs(i, 1);
  if (cant) return false;
  return true;
}
long long cnt() {
  int c = 0;
  memset(mark, 0, sizeof(mark));
  for (int i = 0; i < n; i++)
    if (!mark[i]) {
      c++;
      dfs(i, 1);
    }
  return mypow(2, c);
}
void bin(int b, int e) {
  if (b + 1 == e) {
    val = b;
    cout << b << '\n';
    cout << cnt() << '\n';
    return;
  }
  int mid = (b + e) / 2;
  val = mid - 1;
  if (check()) return bin(b, mid);
  return bin(mid, e);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) dis[i][j] = abs(x[i] - x[j]) + abs(y[i] - y[j]);
  bin(0, 10001);
  return 0;
}
