#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
using namespace std;
const int P = 1e9 + 7;
inline int F(int x) { return x < 0 ? -x : x; }
int n;
int X[5020], Y[5020];
short v[15001000];
short I[15001000], J[15001000];
int mtot;
int bin[5020 + 5020], id[15001000];
int fa[5020 + 5020];
long long mi[5020];
int find(int cur) { return fa[cur] == cur ? cur : fa[cur] = find(fa[cur]); }
int main() {
  read(n);
  mi[0] = 1;
  for (register int i = 1; i <= n; ++i) mi[i] = mi[i - 1] * 2 % P;
  for (register int i = 1; i <= n; ++i) read(X[i]), read(Y[i]);
  for (register int i = 1; i <= n; ++i)
    for (register int j = i + 1; j <= n; ++j)
      ++mtot, I[mtot] = i, J[mtot] = j,
              v[mtot] = F(X[i] - X[j]) + F(Y[i] - Y[j]);
  for (register int i = 1; i <= mtot; ++i) ++bin[v[i]];
  for (register int i = 1; i <= 10000; ++i) bin[i] += bin[i - 1];
  for (register int i = mtot; i; --i) id[bin[v[i]]--] = i;
  for (register int i = 1; i <= n + n; ++i) fa[i] = i;
  int nwtot = n, lsttot = n;
  for (register int nw = mtot; nw; --nw) {
    int np = id[nw];
    int i = I[np], j = J[np];
    int fi0 = find(i), fi1 = find(i + n), fj0 = find(j), fj1 = find(j + n);
    if (fi0 == fj0 || fi1 == fj1) {
      printf("%d\n", v[np]);
      printf("%lld\n", mi[lsttot]);
      return 0;
    }
    if (fi0 != fj1) {
      fa[fi0] = fj1;
      fa[fj0] = fi1;
      --nwtot;
    }
    if (v[id[nw]] != v[id[nw - 1]]) lsttot = nwtot;
  }
  puts("0");
  printf("%lld\n", mi[nwtot]);
  return 0;
}
