#include <bits/stdc++.h>
using namespace std;
int n, mid;
int col[5010][5010];
pair<int, int> b[5010];
long long pw[5010];
int dist(int x, int y, int p, int q) { return abs(x - p) + abs(y - q); }
bool dfs(int x, int y) {
  for (int i = 1; i <= n; i++)
    if (dist(x, y, b[i].first, b[i].second) > mid)
      if (!col[b[i].first][b[i].second]) {
        col[b[i].first][b[i].second] = col[x][y] ^ 3;
        if (!dfs(b[i].first, b[i].second)) return 0;
      } else if (col[b[i].first][b[i].second] == col[x][y])
        return 0;
  return 1;
}
int cnt;
int ans, ansc;
int main() {
  pw[0] = 1;
  for (int i = 1; i <= 5000; i++)
    pw[i] = 2 * (long long)(pw[i - 1]) % 1000000007;
  cin >> n;
  for (int i = 1, x, y; i <= n; i++) {
    cin >> x >> y;
    b[i] = make_pair(x, y);
  }
  int ll = 0, rr = 20000;
  while (ll < rr) {
    mid = (ll + rr) >> 1;
    bool flg = 0;
    memset(col, 0, sizeof(col));
    cnt = 0;
    for (int i = 1; i <= n; i++)
      if (!col[b[i].first][b[i].second]) {
        cnt++;
        col[b[i].first][b[i].second] = 1;
        if (!dfs(b[i].first, b[i].second)) {
          ll = mid + 1;
          flg = 1;
          break;
        }
      }
    if (!flg) {
      rr = mid;
      ans = mid;
      ansc = cnt;
    }
  }
  memset(col, 0, sizeof(col));
  cnt = 0, mid = ll;
  for (int i = 1; i <= n; i++)
    if (!col[b[i].first][b[i].second]) {
      cnt++;
      col[b[i].first][b[i].second] = 1;
      dfs(b[i].first, b[i].second);
    }
  cout << ll << endl << pw[cnt] << endl;
  return 0;
}
