#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0;
  long long f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const long long Md = 1e9 + 7;
long long n, ans, num, col[5005];
struct Pos {
  long long x, y;
} pos[5005];
inline long long Dis(long long i, long long j) {
  return abs(pos[i].x - pos[j].x) + abs(pos[i].y - pos[j].y);
}
inline bool dfs_twomap(long long x, long long len) {
  for (long long y = 1; y <= n; ++y) {
    if (y == x || Dis(x, y) <= len) continue;
    if (col[y] == -1) {
      col[y] = !col[x];
      if (!dfs_twomap(y, len)) return false;
    } else if (col[y] == col[x])
      return false;
  }
  return true;
}
inline bool check(long long len) {
  memset(col, -1, sizeof(col));
  long long cnt = 0;
  for (long long i = 1; i <= n; ++i) {
    if (col[i] == -1) {
      cnt++;
      if (!dfs_twomap(i, len)) return false;
    }
  }
  ans = len;
  num = cnt;
  return true;
}
inline void binary() {
  long long l = 0, r = 10000, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%lld\n", ans);
}
inline long long Q_pow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % Md;
    a = a * a % Md;
    b >>= 1;
  }
  return res;
}
signed main() {
  n = read();
  for (long long i = 1; i <= n; ++i) {
    pos[i].x = read();
    pos[i].y = read();
  }
  binary();
  printf("%lld\n", Q_pow(2, num));
  return 0;
}
