#pragma GCC optimize("Ofast")
#if 1
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using ll = int64_t;
using db = double;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define show(x) cerr << #x << " = " << (x) << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo(x) cout<<((x)?"Yes":"No")<<newl;
#define YESNO(x) cout<<((x)?"YES":"NO")<<newl;
#define v(T) vector<T>
#define vv(T) vector<vector<T>>

template<class A, class B> using umap = unordered_map<A, B>;
template<class A> using uset = unordered_set<A>;

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class A, class B> istream& operator>>(istream& i, pair<A, B>& p) {
  return i >> p.first >> p.second;
}
template<class A, class B, class C> istream& operator>>(istream& i, tuple<A, B, C>& t) {
  return i >> get<0>(t) >> get<1>(t) >> get<2>(t);
}
template<class T> ostream& operator<<(ostream& o, const pair<T, T>& v) {
  o << "(" << v.first << "," << v.second << ")";
  return o;
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T> ostream& operator<<(ostream& o, const set<T>& v) {
  for (auto e : v) {
    o << e << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}


struct P {
  int x, y;
  int dist(const P& v) {
    return max(abs(v.x - x), abs(v.y - y));
  }
};

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N; cin >> N;
  v(P) as(N);
  vpii xs(N), ys(N);
  F0R(i, N) {
    cin >> as[i].x>>as[i].y;
    xs[i] = { as[i].x,i };
    ys[i] = { as[i].y,i };
  }
  sort(rng(xs));
  sort(rng(ys));
  uset<int> vs;
  auto F = [&](int i) {
    vs.insert(xs[i].second);
    vs.insert(ys[i].second);
  };
  F(0); F(1); F(N - 2); F(N - 1);
  vi bs;
  for (auto v : vs) {
    bs.push_back(v);
  }
  vi rs;
  F0R(i, sz(bs)) {
    FOR(j, i + 1, sz(bs)) {
      rs.push_back(as[bs[i]].dist(as[bs[j]]));
    }
  }
  sort(rrng(rs));
  cout << rs[1];
}
#endif

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fr first
#define sc second

const int N = 2e5+5;
const int MOD = 1e9+7;

void solve(){
  int n;
  cin>>n;
  vector<pair<pair<ll,ll>,int> > f,s;
  for(int i=0;i<n;i++){
    ll x,y;
    cin>>x>>y;
    f.pb({{x,y},i});
    s.pb({{y,x},i});
  }
  sort(f.begin(),f.end());
  sort(s.begin(),s.end());
  set<pair<ll,pair<int,int> > >a;
  a.insert({-max(abs(f[0].fr.fr-f[n-1].fr.fr),abs(f[0].fr.sc-f[n-1].fr.sc)),
            {min(f[0].sc,f[n-1].sc),max(f[0].sc,f[n-1].sc)}});/// f[0],f[n-1]

  a.insert({-max(abs(f[0].fr.fr-f[n-2].fr.fr),abs(f[0].fr.sc-f[n-2].fr.sc)),
            {min(f[0].sc,f[n-2].sc),max(f[0].sc,f[n-2].sc)}});/// f[0],f[n-2]

  a.insert({-max(abs(f[1].fr.fr-f[n-1].fr.fr),abs(f[1].fr.sc-f[n-1].fr.sc)),
            {min(f[1].sc,f[n-1].sc),max(f[1].sc,f[n-1].sc)}});/// f[1],f[n-1]

  a.insert({-max(abs(s[0].fr.fr-s[n-1].fr.fr),abs(s[0].fr.sc-s[n-1].fr.sc)),
            {min(s[0].sc,s[n-1].sc),max(s[0].sc,s[n-1].sc)}});/// s[0],s[n-1]

  a.insert({-max(abs(s[0].fr.fr-s[n-2].fr.fr),abs(s[0].fr.sc-s[n-2].fr.sc)),
            {min(s[0].sc,s[n-2].sc),max(s[0].sc,s[n-2].sc)}});/// s[0],s[n-2]

  a.insert({-max(abs(s[1].fr.fr-s[n-1].fr.fr),abs(s[1].fr.sc-s[n-1].fr.sc)),
            {min(s[1].sc,s[n-1].sc),max(s[1].sc,s[n-1].sc)}});/// s[1],s[n-1]

  auto it = a.begin();
  it++;
  cout<<-(it->fr)<<endl;
}

int main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  int t = 1;
 // cin>>t;
  while(t--){
    solve();
  }
  return 0;
}
