#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int N,maxval=0;
    cin>>N;
    int x[N],y[N];
    for(int i=0; i<N; i++)
    {
        cin>>x[i]>>y[i];
    }
    for(int i=1; i<N; i++)
    {
        if(i>0)
        {
            for(int p=i-1; p>=0; p--)
            {
                if(x[i]==x[p] || y[i]==y[p])
                {
                    if(maxval<abs(x[i]-x[p])+abs(y[i]-y[p]))
                    {
                        maxval=abs(x[i]-x[p])+abs(y[i]-y[p]);
                    }
                }
            }
        }
    }
    cout<<maxval;
    return 0;
}
