#include <bits/stdc++.h>
const int N = 5005;
const int MOD = 1000000007;
struct {
  int x, y;
} p[N];
int n, mid, best, tot, vst[N];
inline int abs(const int x) { return x >= 0 ? x : -x; }
int dfs(int u, int c, const int mid) {
  vst[u] = c;
  for (int i = 0; i < n; i++)
    if (i != u && abs(p[i].x - p[u].x) + abs(p[i].y - p[u].y) > mid)
      if (vst[i] < 0 && !dfs(i, c ^ 1, mid) || vst[i] >= 0 && vst[i] == c)
        return 0;
  return 1;
}
int check(const int mid) {
  memset(vst, -1, sizeof vst);
  for (int i = tot = 0; i < n; i++)
    if (vst[i] < 0) {
      if (!dfs(i, 1, mid)) return 0;
      tot++;
    }
  return 1;
}
int calc() {
  int res = 1;
  for (int i = 0; i < tot; i++) res = res * 2 % MOD;
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &p[i].x, &p[i].y);
  for (int L = 0, R = 10000; L <= R;) {
    mid = (L + R) >> 1;
    if (check(mid))
      best = mid, R = mid - 1;
    else
      L = mid + 1;
  }
  check(best);
  printf("%d\n%d", best, calc());
}
