#include <iostream>
#include <cmath>
#define endl "\n"
#define ll long long
using namespace std;

ll n,x[2048],y[2048],i,j,ans=-1;

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
    cin >> n;
    for(i=0;i<n;i++){
        cin >> x[i] >> y[i];
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            int curr=-1;
            if(x[i]==x[j]){
                curr=abs(y[i]-y[j]);
            }
            if(y[i]==y[j]){
                curr=abs(x[i]-x[j]);
            }
            if(curr>ans){
                ans=curr;
            }
        }
    }
    cout << ans << endl;
}
