#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10, MN = 5e3 + 5;
int n;
bool mk[MN], col[MN];
int d[MN][MN], x[MN], y[MN];
bool F;
void dfs(int s, int val) {
  mk[s] = true;
  for (int v = 0; v < n; ++v)
    if (d[s][v] > val) {
      if (!mk[v]) {
        col[v] = !col[s];
        dfs(v, val);
      } else if (col[v] == col[s])
        F = true;
    }
}
int check(int val) {
  int ret = 0;
  F = false;
  memset(mk, 0, sizeof mk), memset(col, 0, sizeof col);
  for (int i = 0; i < n; ++i)
    if (!mk[i]) dfs(i, val), ++ret;
  if (F) return -1;
  return ret;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i] >> y[i];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) d[i][j] = abs(x[i] - x[j]) + abs(y[i] - y[j]);
  int L = 0, R = 5e5 + 5;
  while (L ^ R) {
    int mid = L + R >> 1;
    if (~check(mid))
      R = mid;
    else
      L = mid + 1;
  }
  int x = check(L);
  int pw = 1, md = 1e9 + 7;
  while (x--) {
    pw = pw + pw;
    if (pw >= md) pw -= md;
  }
  cout << L << '\n' << pw << '\n';
  return 0;
}
