#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i;
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  for (i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(pair<int, int>(x, y));
  }
  sort(v.begin(), v.end());
  cout << min(abs(v[n - 1].first - v[0].first),
              abs(v[n - 1].second - v[0].second))
       << endl;
  return 0;
}
