#include <bits/stdc++.h>
using namespace std;
int main()
{
int m;
int b=-1,s=10000;
vector<int>xx;
vector<int>yy;
cin>>m;
for(int i=0;i<m;++i){
int x,y;
cin>>x;
cin>>y;
xx.push_back(x);
yy.push_back(y);
}
for(int i=0;i<m-1;++i){
if(abs(xx[i+1]-xx[i])+abs(yy[i+1]-yy[i])>b){
b=abs(xx[i+1]-xx[i])+abs(yy[i+1]-yy[i]);
}
if(abs(xx[i+1]-xx[i])+abs(yy[i+1]-yy[i])<s){
s=abs(xx[i+1]-xx[i])+abs(yy[i+1]-yy[i]);
}
}
cout<<b<<" "<<s;
return 0;
}