#include <bits/stdc++.h>
using namespace std;
const int maxn = 5010;
const int Mod = 1e9 + 7;
vector<int> G[maxn];
int x[maxn], y[maxn], vis[maxn], col[maxn], N;
int qpos(int a, int x) {
  int res = 1;
  while (x) {
    if (x & 1) res = (res * 1ll * a) % Mod;
    x >>= 1;
    a = (a * 1ll * a) % Mod;
  }
  return res;
}
void read(int &res) {
  char ch = getchar();
  res = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    res = (res << 3) + (res << 1) + ch - '0';
}
void init(int len) {
  for (int i = 1; i <= N; i++) vis[i] = 0, G[i].clear();
  for (int i = 1; i <= N; i++)
    for (int j = i + 1; j <= N; j++) {
      int dis = abs(x[i] - x[j]) + abs(y[i] - y[j]);
      if (dis > len) {
        G[i].push_back(j);
        G[j].push_back(i);
      }
    }
}
bool dfs(int u, int opt) {
  vis[u] = 1;
  col[u] = opt;
  int L = G[u].size();
  for (int i = 0; i < L; i++) {
    int v = G[u][i];
    if (!vis[v]) {
      if (!dfs(v, opt ^ 1)) return false;
    } else if (col[v] == opt)
      return false;
  }
  return true;
}
bool check(int len) {
  init(len);
  for (int i = 1; i <= N; i++) {
    if (!vis[i]) {
      if (!dfs(i, 0)) return false;
    }
  }
  return true;
}
int main() {
  read(N);
  for (int i = 1; i <= N; i++) read(x[i]), read(y[i]);
  int L = 0, R = 10000, Mid, ans = 0;
  while (L <= R) {
    Mid = (L + R) >> 1;
    if (check(Mid))
      ans = Mid, R = Mid - 1;
    else
      L = Mid + 1;
  }
  init(ans);
  int cnt = 0, ans2;
  for (int i = 1; i <= N; i++) {
    if (!vis[i]) {
      cnt++;
      dfs(i, 0);
    }
  }
  ans2 = qpos(2, cnt);
  printf("%d\n%d\n", ans, ans2);
  return 0;
}
