#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000 + 10, MOD = 1000000007;
vector<pair<int, int> > lis[MAXN * 2];
pair<int, int> p[MAXN];
int n, f[MAXN], cnt;
bool b[MAXN];
int dis(const pair<int, int> &a, const pair<int, int> &b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
int getf(int first) {
  if (first == f[first]) return first;
  int fx = f[first];
  f[first] = getf(f[first]);
  b[first] ^= b[fx];
  return f[first];
}
bool Merge(int first, int second) {
  int fx = getf(first), fy = getf(second);
  if (fx == fy) return b[first] ^ b[second];
  f[fx] = fy;
  b[fx] = b[first] ^ b[second] ^ 1;
  --cnt;
  return true;
}
int Pow(int a, int b) {
  int d = 1;
  for (; b; d = (b & 1) ? (long long)d * a % MOD : d,
            a = (long long)a * a % MOD, b /= 2)
    ;
  return d;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d%d", &p[i].first, &p[i].second);
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n; ++j)
      lis[dis(p[i], p[j])].push_back(make_pair(i, j));
  cnt = n;
  for (int i = 1; i <= n; ++i) f[i] = i, b[i] = 0;
  for (int i = MAXN * 2 - 1; i >= 1; --i) {
    bool flag = true;
    int sum = cnt;
    for (vector<pair<int, int> >::iterator it = lis[i].begin();
         it != lis[i].end(); ++it)
      if (!Merge(it->first, it->second)) {
        flag = false;
        break;
      }
    if (!flag) {
      cout << i << endl;
      cout << Pow(2, sum) << endl;
      exit(0);
    }
  }
  cout << 0 << endl << 2 << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
