#include <bits/stdc++.h>
using namespace std;
const int maxN = 5e3 + 13, mod = 1e9 + 7;
int n, x[maxN], y[maxN], col[maxN], flag, ans;
vector<pair<double, pair<int, int>>> vec;
bool mark[maxN];
vector<int> adj[maxN];
void dfs(int x, bool c) {
  mark[x] = 1;
  col[x] = c;
  for (auto a : adj[x]) {
    if (!mark[a])
      dfs(a, !c);
    else if (col[a] == c)
      flag = 0;
  }
}
int pw(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = (long long)a * a % mod)
    if (b & 1) res = (long long)res * a % mod;
  return res;
}
double dis(int i, int j) { return abs(x[i] - x[j]) + abs(y[i] - y[j]); }
bool can(int x, bool t) {
  int res = 0;
  for (int i = 0; i < n; i++) adj[i].clear();
  memset(mark, 0, sizeof mark);
  memset(col, -1, sizeof col);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (dis(i, j) > x) {
        adj[i].push_back(j);
        adj[j].push_back(i);
      }
  for (int i = 0; i < n; i++) {
    if (!mark[i]) {
      flag = 1;
      dfs(i, 1);
      if (!flag) return 0;
      res++;
    }
  }
  if (t) ans = res;
  return 1;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  if (n == 2) return cout << 0 << '\n' << 2 << endl, 0;
  int l = 0, r = 1e7;
  while (r - l > 1) {
    int mid = l + r >> 1;
    if (can(mid, 0))
      r = mid;
    else
      l = mid;
  }
  cout << r << endl;
  can(r, 1);
  cout << pw(2, ans) << endl;
}
