#include <bits/stdc++.h>
using namespace std;
const int N = 5005, P = 1000000007;
using ll = long long;
int n, x[N], y[N], clr[N];
vector<int> v[N];
ll qpow(ll a, ll b) {
  ll ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % P;
    a = a * a % P;
    b >>= 1;
  }
  return ret;
}
bool vis[N];
bool bfs(int pos) {
  clr[pos] = 0;
  queue<int> q;
  q.push(pos);
  while (!q.empty()) {
    int nd = q.front();
    q.pop();
    for (auto &i : v[nd])
      if (clr[i] == -1)
        clr[i] = clr[nd] ^ 1, q.push(i);
      else if (clr[i] == clr[nd])
        return 0;
  }
  return 1;
}
int check(int mid) {
  for (int i = 1; i <= n; i++) v[i].clear();
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      if (abs(x[i] - x[j]) + abs(y[i] - y[j]) > mid)
        v[i].push_back(j), v[j].push_back(i);
  memset(clr, -1, sizeof(clr));
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (clr[i] == -1) {
      if (!bfs(i)) return 0;
      ++cnt;
    }
  return qpow(2, cnt);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  int l = 0, r = 10000, ans = -1, cnt = 0;
  while (l <= r) {
    int mid = (l + r) >> 1, tmp;
    if ((tmp = check(mid)))
      ans = mid, r = mid - 1, cnt = tmp;
    else
      l = mid + 1;
  }
  cout << ans << endl << cnt << endl;
  return 0;
}
