a=int(input())
b=[list(map(int,input().split(' '))) for _ in range(a)]
ab=[]
#for i in range(len(b)):
# if b[i][0]<0 and b[i][1]<0:
# b[i][0]=b[i][0]*-1
for i in range(1,len(b)):
#print(abs(b[i][0]-b[i][1]),abs(b[i-1][0]-b[i-1][1]))
ab.append(abs(b[i][1]-b[i-1][1])+abs(b[i-1][0]-b[i][0]))
print(max(ab),min(ab))