#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3 + 10, MOD = 1e9 + 7;
pair<int, int> p[MAXN];
int n, l, r, mid, color[MAXN], t;
bool bo[MAXN], boo;
int nei(pair<int, int> p1, pair<int, int> p2) {
  return abs(p1.first - p2.first) + abs(p1.second - p2.second);
}
void dfs(int u, int dist, int col) {
  bo[u] = true, color[u] = col;
  for (int i = 0; i < n; i++) {
    if (nei(p[u], p[i]) >= dist) {
      if (color[u] == color[i]) boo = false;
      if (!bo[i]) dfs(i, dist, 1 - col);
    }
  }
}
bool good(int dist) {
  for (int i = 0; i < n; i++) bo[i] = false, color[i] = -1;
  boo = true, t = 1;
  for (int i = 0; i < n; i++)
    if (!bo[i]) dfs(i, dist, 0), t *= 2, t %= MOD;
  return boo;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d %d", &p[i].first, &p[i].second);
  l = -1, r = 1e4 + 1e3;
  while (r - l > 1) {
    mid = (l + r) / 2;
    if (good(mid))
      r = mid;
    else
      l = mid;
  }
  cout << l << '\n';
  mid = r, good(mid);
  return cout << t << endl, 0;
}
