#include <stdio.h>
int main(){
int num1;
scanf("%d",&num1);
int station[num1][2];
for(int i=0;i<num1;i=i+1){
scanf("%d",&station[i][0]);
scanf("%d",&station[i][1]);
}
int rang1[num1-1];
for(int i=0;i<num1-1;i=i+1){
int x=station[i][0]-station[i+1][0];
if(x<0){
x=x*-1;
}
int y=station[i][1]-station[i+1][1];
if(y<0){
y=y*-1;
}
rang1[i]=x+y;
}
int max=rang1[0],min=rang1[0];
for(int i=0;i<num1-1;i++){
if(rang1[i]>max){
max = rang1[i];
}
if(rang1[i]<min){
min = rang1[i];
}
}
printf("%d %d",max,min);
}