#include <bits/stdc++.h>
using namespace std;
int n, x[5000 + 5], y[5000 + 5], col[5000 + 5], l, r, mid, cnt = 1,
                                                           fl[5000 + 5], flag;
inline int dis(int a, int b) {
  return ((x[a] - x[b]) > 0 ? (x[a] - x[b]) : -(x[a] - x[b])) +
         ((y[a] - y[b]) > 0 ? (y[a] - y[b]) : -(y[a] - y[b]));
}
inline void dfs(int x, int w, int mid) {
  if (!flag) return;
  if (col[x]) {
    col[x] != w && (flag = 0);
    return;
  }
  col[x] = w;
  for (int i = 1; i <= n; i++)
    if (dis(x, i) > mid) dfs(i, w * -1, mid);
}
inline int check(int mid) {
  memset(col, 0, sizeof(col));
  flag = 1;
  for (int i = 1; i <= n; i++) !col[i] && (dfs(i, 1, mid), 0);
  return flag;
}
inline void find(int x, int mid) {
  if (fl[x]) return;
  fl[x] = 1;
  for (int i = 1; i <= n; i++)
    if (dis(x, i) > mid) find(i, mid);
}
int main() {
  register int i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    scanf("%d%d", &x[i], &y[i]), l = ((l) > (x[i]) ? (l) : (x[i])),
                                 r = ((r) > (y[i]) ? (r) : (y[i]));
  r += l + 2;
  l = -1;
  while (l + 1 < r) mid = l + r >> 1, (check(mid) ? r : l) = mid;
  printf("%d\n", r);
  for (i = 1; i <= n; i++) !fl[i] && (find(i, r), cnt = cnt * 2 % 1000000007);
  printf("%d\n", cnt);
}
