class seg: def __init__(self,n,e,f): self.size=1 self.e=e self.f=f while self.size>=1;r>>=1 return res N=int(input()) X=[0]*N;Y=[0]*N for i in range(N): X[i],Y[i]=map(int,input().split()) P=[0]*N;Q=[N+N]*N A=0;B=N*N;C=-N;D=N for i in range(N): A=max(A,X[i]+Y[i]) B=min(B,X[i]+Y[i]) C=max(C,X[i]-Y[i]) D=min(D,X[i]-Y[i]) for i in range(N): P[i]=max(A-X[i]-Y[i],X[i]+Y[i]-B,Y[i]-X[i]+C,X[i]-Y[i]-D) p=seg(N,-N-N,max) order=[0]*N def f(a): return X[a] for i in range(N): order[i]=i order.sort(key=f) for rp in range(4): for i in range(N): X[i]=N+1-X[i] order.reverse() if rp&1: for i in range(N): Y[i]=N+1-Y[i] p.clear() for a in order: Q[a]=min(Q[a],X[a]+Y[a]-p.prod(0,Y[a])) p.set(Y[a]-1,Y[a]+X[a]) for i in range(N): P[i]-=Q[i] print(min(P))