#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3 + 10, MOD = 1e9 + 7;
int n, ans, l = -1, r = 1e4 + 10, mid, mark[MAXN];
pair<int, int> a[MAXN];
bool first;
vector<int> adj[MAXN];
inline int Dis(int i, int j) {
  return abs(a[i].first - a[j].first) + abs(a[i].second - a[j].second);
}
inline void Make(int mid) {
  memset(mark, 0ll, sizeof(mark));
  for (int i = 0; i < n; i++) adj[i].clear();
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (Dis(i, j) > mid) adj[i].push_back(j), adj[j].push_back(i);
}
inline void DFS(int v) {
  for (auto u : adj[v]) {
    if (!mark[u])
      mark[u] = 3 ^ mark[v], DFS(u);
    else
      first &= (mark[v] != mark[u]);
  }
}
inline bool Check(int mid) {
  Make(mid);
  ans = first = 1;
  for (int i = 0; i < n; i++)
    if (!mark[i]) mark[i] = 1, ans <<= 1, ans %= MOD, DFS(i);
  return first;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (Check(mid))
      r = mid;
    else
      l = mid;
  }
  Check(r);
  cout << r << '\n' << ans;
}
