#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;
struct yyy {
  int to, z;
};
struct ljb {
  int head, h[5000 + 5];
  yyy f[5000 * 5000 + 5];
  inline void add(int x, int y) {
    f[++head] = (yyy){y, h[x]};
    h[x] = head;
  }
} s;
inline void dfs(int x, int w) {
  if (col[x]) {
    col[x] != w && (flag = 0);
    return;
  }
  yyy tmp;
  col[x] = w;
  for (int i = s.h[x]; i; i = tmp.z) tmp = s.f[i], dfs(tmp.to, w * -1);
}
inline int check(int mid) {
  memset(col, 0, sizeof(col));
  s.head = 0;
  memset(s.h, 0, sizeof(s.h));
  register int i, j;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++)
      if (((x[i] - x[j]) > 0 ? (x[i] - x[j]) : -(x[i] - x[j])) +
              ((y[i] - y[j]) > 0 ? (y[i] - y[j]) : -(y[i] - y[j])) >
          mid)
        s.add(i, j);
  }
  flag = 1;
  for (i = 1; i <= n; i++) !col[i] && (dfs(i, 1), 0);
  return flag;
}
inline void find(int x) {
  if (fl[x]) return;
  yyy tmp;
  fl[x] = 1;
  for (int i = s.h[x]; i; i = tmp.z) tmp = s.f[i], find(tmp.to);
}
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);
  check(r);
  for (i = 1; i <= n; i++) !fl[i] && (find(i), cnt = cnt * 2 % 1000000007);
  printf("%d\n", cnt);
}
