#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000 + 17, mod = 1e9 + 7;
short int n, min_ans, col[MAXN], cmp_cnt;
pair<short int, short int> a[MAXN];
bool mark[MAXN];
vector<pair<short int, short int> > sort_helper[MAXN * 2], edge;
vector<short int> adj[MAXN];
void input() {
  cin >> n;
  for (short int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
}
short int dist(short int i, short int j) {
  return abs(a[i].first - a[j].first) + abs(a[i].second - a[j].second);
}
void clear_all() {
  for (short int i = 1; i <= n; i++) adj[i].clear();
  for (short int i = 1; i <= n; i++) col[i] = 0;
}
void add_edge_befor(short int x) {
  for (short int i = 1; i <= n; i++)
    for (short int j = i + 1; j <= n; j++)
      if (dist(i, j) > x) adj[i].push_back(j), adj[j].push_back(i);
}
bool dfs_bipartite(short int v, short int c) {
  bool res = true;
  col[v] = c;
  for (auto u : adj[v]) {
    if (col[u] == col[v]) res = false;
    if (!col[u]) {
      if (!dfs_bipartite(u, 3 - col[v])) res = false;
    }
  }
  return res;
}
bool is_Bipartite() {
  bool res = true;
  for (short int i = 1; i <= n; i++)
    if (!col[i])
      if (!dfs_bipartite(i, 1)) res = false;
  return res;
}
void binary_search() {
  short int l = -1, r = 2 * MAXN;
  while (l + 1 < r) {
    short int mid = (r + l) / 2;
    clear_all();
    add_edge_befor(mid);
    bool is_Bip = is_Bipartite();
    if (!is_Bip)
      l = mid;
    else
      r = mid;
  }
  min_ans = r;
}
void dfs(short int v) {
  mark[v] = true;
  for (auto i : adj[v])
    if (!mark[i]) dfs(i);
}
void find_components() {
  clear_all();
  add_edge_befor(min_ans);
  for (short int i = 1; i <= n; i++)
    if (!mark[i]) {
      cmp_cnt++;
      dfs(i);
    }
}
int pw2() {
  int res = 1;
  for (short int i = 1; i <= cmp_cnt; i++) res *= 2, res %= mod;
  return res;
}
void output() {
  cout << min_ans << endl;
  cout << pw2() << endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  input();
  binary_search();
  find_components();
  output();
  return 0;
}
