#include <bits/stdc++.h>
using namespace std;
const int M = 5005;
const int mod = 1e9 + 7;
int n, mid, ans;
int x[M], y[M];
bool vis[M], col[M];
inline int read() {
  int x = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  return x;
}
inline int dis(int i, int k) { return abs(x[i] - x[k]) + abs(y[i] - y[k]); }
inline bool dfs(int x) {
  vis[x] = 1;
  for (int i = 1; i <= n; i++)
    if (i != x && dis(i, x) > mid) {
      if (!vis[i]) {
        col[i] = !col[x];
        if (dfs(i)) return 1;
      } else if (col[i] == col[x])
        return 1;
    }
  return 0;
}
inline bool check() {
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++)
    if (!vis[i])
      if (dfs(i)) return 0;
  return 1;
}
inline void sfd(int x) {
  vis[x] = 1;
  for (int i = 1; i <= n; i++)
    if (!vis[i] && dis(i, x) > ans) sfd(i);
  return;
}
inline int fpow(int a, int b) {
  int ans = 1;
  for (; b; a = (a * a) % mod, b >>= 1)
    if (b & 1) ans = (ans * a) % mod;
  return ans % mod;
}
int main() {
  n = read();
  int que = 1;
  for (int i = 1; i <= n; i++) x[i] = read(), y[i] = read();
  int r = 10000, l = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check())
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++)
    if (!vis[i]) sfd(i), que = (long long)(que << 1) % mod;
  cout << ans << endl << que;
  return 0;
}
