///////////////////////Loading Payloads.......////////////////////////////
#include<bits/stdc++.h>
#define f(i,a,b) for(int i = a; i < b; i++)
#define fd(i,a,b) for(int i = a; i > b;i--)
#define fld(i,a,b) for(ll i = a ; i > b;i--)
#define ll long long
#define fl(i,a,b) for(ll i = a; i < b; i++)
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPL vector<pair<ll,ll>>
#define VS vector<string>
#define VL vector<long long>
#define VC vector<char>
#define VF vector<float>
#define VD vector<double>
#define VB vector<bool>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define fa(i,skill) for(auto i : skill)
#define fr(i,skill) for(VI :: reverse_iterator i = skill.rbegin(); i != skill.rend(); i++)
#define PI pair<int,int>
#define mi map<int,int>
#define ml map<ll,ll>
#define mci map<char,int>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define MAX 1000000007
#define INF 1000000000
#define debug(x) cout<<"This side    ----> "<<#x<<" -> "<<x<<endl
using namespace std;
 
///////////////////////Engine Check.......////////////////////////////
void edit(VI &skill,int n)
{
    f(i,0,n)
        {
            int x;
            cin >> x;
            skill.PB(x);
        }
}
 
 
bool cmp(pair<ll,ll>p1,pair<ll,ll>p2)
{
    if(p1.S > p2.S)
        return true;
    if(p1.S < p2.S)
        return false;
    if(p1.F > p2.F)
        return true;
    else
        return false;
}
void editl(VL &skill,ll n)
{
    fl(i,0,n)
        {
            ll x;
            cin >> x;
            skill.PB(x);
        }
}
void editpl(VPL &skill,ll n)
{
    fl(i,0,n)
        {
            ll x,y;
            cin >> x >> y;
            skill.PB({x,y});
        }
}
ll nextPowerOf2(ll n) 
{
    n--;
    n |= n >> 1;
    n |= n >> 2;
    n |= n >> 4;
    n |= n >> 8;
    n |= n >> 16;
    n++;
    return n;
}





bool isGoogles = 0;
bool testcase = 0;

void achilles() 
{

    ll n;cin >> n;
    VPL arr,arr2;

    fl(i,0,n)
    {
        ll x,y;cin >>x >> y;
        arr.PB({x,y});
        arr2.PB({y,x});
    }

    sort(all(arr));
    sort(all(arr2));



    ll mxx1 = abs(arr[n-2].F - arr[0].F);
    ll mxx2 = abs(arr[n-1].F - arr[1].F);

    ll mxy1 = abs(arr2[n-2].F - arr2[0].F);
    ll mxy2 = abs(arr2[n-1].F - arr2[1].F);

    ll maxx = abs(arr[n-1].F - arr[0].F);
    ll maxy = abs(arr2[n-1].F - arr2[0].F);

    // if(maxx > maxy)

    // debug(arr2[n-1].F);debug(arr2[0].F);
    // debug(maxx);
    // debug(maxy);
    // debug(mxx1);
    // debug(mxx2);
    // debug(mxy1);
    // debug(mxy2);
    // cout << max(max(mxx1,mxx2),max(mxy1,mxy2)) << "\n";


    if(arr[n-1] == arr2[n-1])
    {
        // cout << arr[n].F << ' ' << arr[n].S << "\n";
        // cout << arr2[n].F << ' ' << arr2[n].S << "\n";
        cout << max(max(mxx1,mxx2),max(mxy1,mxy2)) << "\n";        
    }
    else
    {
        VL ex;
        ex.PB(maxx);
        ex.PB(maxy);
        ex.PB(mxx1);
        ex.PB(mxx2);
        ex.PB(mxy1);
        ex.PB(mxy2);

        sort(rall(ex));


        cout << ex[1] << "\n";
    }
    





}
    

///////////////////////3....2....1...Ignition////////////////////////////
 
int main()
{
 
    ios :: sync_with_stdio(0);
    cin.tie(0);


    ll t=1,w=1;
    if(testcase)
    cin >>t;
 
    while(t--)
    {   if (isGoogles) {cout << "Case #" << w << ": ";}
        achilles();
        w++;
    }
    return 0;  
}
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<ll, ll>> vpll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vll> vvll;
typedef pair<int, int> P;
typedef map<int, int> mii;
typedef set<int> si;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define fi first
#define se second
// #include <atcoder/all>
// using namespace atcoder;
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T, class U>
inline bool chmax(T& a, U b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T, class U>
inline bool chmin(T& a, U b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T, class U>
ostream& operator<<(ostream& os, pair<T, U>& p) {
    cout << "(" << p.first << ", " << p.second << ")";
    return os;
}
template <class T>
inline void dump(T& v) {
    if (v.size() > 100) {
        cout << "ARRAY IS TOO LARGE!!!" << endl;
    } else {
        irep(i, v) { cout << (*i) << ((i == --v.end()) ? '\n' : ' '); }
    }
}
template <class T, class U>
inline void dump(map<T, U>& v) {
    if (v.size() > 100) {
        cout << "ARRAY IS TOO LARGE!!!" << endl;
    } else {
        irep(i, v) { cout << i->first << " " << i->second << '\n'; }
    }
}
template <class T, class U>
inline void dump(pair<T, U>& p) {
    cout << p.first << " " << p.second << '\n';
}
inline void yn(const bool b) { b ? fin("yes") : fin("no"); }
inline void Yn(const bool b) { b ? fin("Yes") : fin("No"); }
inline void YN(const bool b) { b ? fin("YES") : fin("NO"); }
const int INF = INT_MAX;
constexpr ll LLINF = 1LL << 61;
constexpr ll MOD = 1000000007;  // 998244353; //
constexpr ld EPS = 1e-11;
void Case(int i) { printf("Case #%d: ", i); }
/* --------------------   ここまでテンプレ   -------------------- */

int main() {
    int n;
    cin >> n;
    // vi v(n);
    // rep(i, n) cin >> v[i];
    cout<<n-1<<endl;
}
