#include <bits/stdc++.h>
using namespace std;
const int N = 5000 + 5, MOD = 1e9 + 7;
int n, ans;
pair<long long, long long> mat[N];
bool mark[N], color[N], flag;
void read_input() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    mat[i] = {x, y};
  }
}
int dis(int u, int v) {
  int x1 = mat[u].first;
  int y1 = mat[u].second;
  int x2 = mat[v].first;
  int y2 = mat[v].second;
  return abs(y2 - y1) + abs(x2 - x1);
}
void dfs(int v, int par, int ind) {
  mark[v] = 1;
  for (int u = 1; u <= n; u++) {
    if (dis(u, v) <= ind) {
      continue;
    }
    if (u == par) {
      continue;
    }
    if (!mark[u]) {
      color[u] = 1 - color[v];
      dfs(u, v, ind);
    } else {
      if (color[u] == color[v]) {
        flag = false;
      }
    }
  }
}
bool check(int ind) {
  memset(mark, 0, sizeof mark);
  flag = true;
  for (int i = 1; i <= n; i++) {
    if (!mark[i]) {
      dfs(i, -1, ind);
    }
  }
  return flag;
}
void DFS(int v, int ind) {
  mark[v] = true;
  for (int u = 1; u <= n; u++) {
    if (dis(u, v) <= ind) {
      continue;
    }
    if (!mark[u]) {
      DFS(u, ind);
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  read_input();
  int l = 0, r = 10000;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (check(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  if (check(0)) {
    r = 0;
  }
  cout << r << '\n';
  memset(mark, 0, sizeof mark);
  ans = 1;
  for (int i = 1; i <= n; i++) {
    if (!mark[i]) {
      ans *= 2;
      ans %= MOD;
      DFS(i, r);
    }
  }
  cout << ans << '\n';
  return 0;
}
