#include <bits/stdc++.h>
using namespace std;
const int N = 5010, mod = 1000000007;
int ufs[N], val[N];
pair<int, int> query(int a) {
  if (ufs[a] == a)
    return pair<int, int>(a, 0);
  else {
    pair<int, int> res = query(ufs[a]);
    res.second ^= val[a];
    ufs[a] = res.first, val[a] = res.second;
    return res;
  }
}
inline int ab(int x) { return x > 0 ? x : -x; }
vector<pair<int, int> > edge[10010];
int x[N], y[N], n, ans;
bool sch[N];
void dfs(int a) {
  for (int i = 0; i < n; i++)
    if (!sch[i]) {
      int d = ab(x[i] - x[a]) + ab(y[i] - y[a]);
      if (d > ans) {
        sch[i] = true;
        dfs(i);
      }
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d %d", &x[i], &y[i]);
  for (int i = 0; i < n; i++) ufs[i] = i, val[i] = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int d = ab(x[i] - x[j]) + ab(y[i] - y[j]);
      edge[d].push_back(pair<int, int>(i, j));
    }
  ans = 10000;
  for (int i = 10000; i >= 1; i--) {
    bool ok = true;
    for (vector<pair<int, int> >::iterator ite = edge[i].begin();
         ok && ite != edge[i].end(); ++ite) {
      int tx = ite->first, ty = ite->second;
      pair<int, int> rx = query(tx), ry = query(ty);
      if (rx.first != ry.first) {
        ufs[rx.first] = ry.first;
        val[rx.first] = (1 ^ rx.second ^ ry.second);
      } else {
        if ((rx.second ^ ry.second) == 0) {
          ok = false;
        }
      }
    }
    if (ok)
      ans = i - 1;
    else
      break;
  }
  printf("%d\n", ans);
  memset(sch, 0, sizeof sch);
  int pwr = 0;
  for (int i = 0; i < n; i++)
    if (!sch[i]) {
      ++pwr;
      sch[i] = true;
      dfs(i);
    }
  int res = 1;
  while (pwr) {
    --pwr;
    res <<= 1;
    if (res >= mod) res -= mod;
  }
  printf("%d\n", res);
  return 0;
}
