#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7;
int n;
int X[5010], Y[5010];
int par[10010], rnk[10010];
inline int myabs(int x) { return x < 0 ? -x : x; }
int getpar(int x) { return par[x] == x ? x : par[x] = getpar(par[x]); }
void un(int x, int y) {
  x = getpar(x);
  y = getpar(y);
  if (x == y) return;
  if (rnk[x] < rnk[y])
    par[x] = y;
  else {
    if (rnk[x] == rnk[y]) rnk[x]++;
    par[y] = x;
  }
}
vector<int> G[5010];
int dis[5010][5010];
int cnt;
int ans;
bool vis[5010];
void dfs(int x) {
  vis[x] = true;
  for (int i = 0; i < (int)G[x].size(); i++) {
    int y = G[x][i];
    if (vis[y]) continue;
    dfs(y);
  }
}
bool check(int x) {
  for (int i = 1; i <= n + n; i++) par[i] = i, rnk[i] = 0;
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (dis[i][j] > x) {
        if (getpar(i) == getpar(j)) return false;
        un(i, j + n);
        un(i + n, j);
      }
    }
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", X + i, Y + i);
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      dis[i][j] = myabs(X[i] - X[j]) + myabs(Y[i] - Y[j]);
    }
  }
  int l = 0, r = 10000;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", r + 1);
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (dis[i][j] > r + 1) {
        G[i].push_back(j);
        G[j].push_back(i);
      }
    }
  }
  ans = 1;
  for (int i = 1; i <= n; i++) {
    if (vis[i]) continue;
    ans = (ans + ans) % md;
    dfs(i);
  }
  printf("%d", ans);
  return 0;
}
