peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
xy = [list(map(int,input().split())) for _ in range(N)]
ma = -float('inf')
mi = float('inf')
for x,y in xy:
  ma = max(ma,x-y)
  mi = min(mi,x-y)
ans = ma - mi

ma = -float('inf')
mi = float('inf')
for x,y in xy:
  ma = max(ma,x+y)
  mi = min(mi,x+y)
  
ans = max(ans, ma - mi)
print(ans)
import numpy as np

N = int(input())
XY_set = np.array(list(set(tuple(map(int, input().split())) for _ in range(N))))

XpY = XY_set[:, 0] + XY_set[:, 1]
XmY = XY_set[:, 0] - XY_set[:, 1]

ans = max(XpY.max() - XpY.min(), XmY.max() - XmY.min())
print(ans)
N = int(input())
Array1 = []
Array2 = []

for i in range(N):
    next_x, next_y = map(int, input().split())
    s = next_x + next_y
    t = next_x - next_y
    Array1.append(s)
    Array2.append(t)

print(max(max(Array1)-min(Array1),max(Array2)-min(Array2)))
N = int(input())
L = [10**10]*4
for _ in range(N):
  x,y = [int(i) for i in input().split()]
  L[0] = min(L[0],x+y)
  L[1] = min(L[1],x-y+10**9)
  L[2] = min(L[2],-x+y+10**9)
  L[3] = min(L[3],-x-y+2*(10**9))
print(max(2*(10**9)-L[0]-L[3],2*(10**9)-L[1]-L[2]))
def main():
    N = int(input())
    X, Y = [], []
    for _ in range(N):
        x, y = map(int, input().split())
        X.append(x - y)
        Y.append(x + y)
    return max(max(X) - min(X), max(Y) - min(Y))


print(main())
n = int(input())

for i in range(n):
    x,y = map(int,input().split())
    if i == 0:
        summax = x+y
        summin = x+y
        diffmax = x-y
        diffmin = x-y

    if x+y > summax:
        summax = x+y
    if x+y < summin:
        summin = x+y
    if x-y > diffmax:
        diffmax = x-y
    if x-y < diffmin:
        diffmin = x-y

a = summax-summin
b = diffmax-diffmin
sol = max(a,b)
print(sol)
import sys
input = sys.stdin.readline

N = int(input())
xy = [[int(i) for i in input().split()] for _ in range(N)]

d1 = []
d2 = []
for x, y in xy :
  d1.append(x + y)
  d2.append(x - y)

d1.sort(reverse=True)
d2.sort(reverse=True)

print(max(
  d1[0] - d1[-1],
  d2[0] - d2[-1],
))
def main():
    n = int(input())
    d1 = []
    d2 = []
    for _ in range(n):
        x, y = map(int, input().split())
        d1.append(x + y)
        d2.append(x - y)
    d1.sort()
    d2.sort()
    print(max(d1[-1] - d1[0], d2[-1] - d2[0]))


if __name__ == '__main__':
    main()
n = int(input())
p = [0 for _ in range(n)]
m = [0 for _ in range(n)]
for i in range(n):
  xi,yi = map(int,input().split())
  p[i] = xi+yi
  m[i] = xi-yi
p.sort()
m.sort()
print(max(p[-1] - p[0],m[-1] - m[0]))
N=int(input())
xy=[tuple(map(int,input().split())) for _ in range(N)]
ans=0
zmi=10**10
zma=-10**10
wmi=10**10
wma=-10**10
for x,y in xy:
    zmi=min(zmi,x+y)
    zma=max(zma,x+y)
    wmi=min(wmi,x-y)
    wma=max(wma,x-y)
print(max(zma-zmi,wma-wmi))
import sys
input = sys.stdin.readline

N = int(input())
points = [0] * N
rx = []
ry = []
for i in range(N):
    x, y = map(int, input().split())
    rx.append(x - y)
    ry.append(x + y)
xm = max(rx)
xn = min(rx)
ym = max(ry)
yn = min(ry)
ans = max(max(xm - x, x - xn, ym - y, y - yn) for x, y in zip(rx, ry))
print(ans)
N = int(input())
L = [tuple(map(int, input().split())) for _ in range(N)]
L.sort(key=lambda x: x[0]+x[1])
a = abs(L[0][0]-L[-1][0])+abs(L[0][1]-L[-1][1])
L.sort(key=lambda x: x[0]-x[1])
b = abs(L[0][0]-L[-1][0])+abs(L[0][1]-L[-1][1])
print(max(a, b))
n=int(input())

xy=[[int(_) for _ in input().split()]for i in range(n)]

print(max(max([a[0]+a[1] for  a in xy])-min([a[0]+a[1] for  a in xy]),max([a[0]-a[1] for  a in xy])-min([a[0]-a[1] for  a in xy])))
# print(max([a[0]-a[1] for  a in xy])-min([a[0]-a[1] for  a in xy]))
N = int(input())
xys = [tuple(map(int, input().split())) for _ in range(N)]

xpys = [x + y for x, y in xys]
dist1 = max(xpys) - min(xpys)
xmys = [x - y for x, y in xys]
dist2 = max(xmys) - min(xmys)
print(max(dist1, dist2))
n=int(input())
D=0
d=10**10
f=10**10
F=-10**10
for i in range(n):
    x,y=[int(x) for x in input().split()]
    l=x+y
    d=min(d,l)
    D=max(D,l)
    if y-x<f:
        m=[x,y]
        f=y-x
    if y-x>F:
        M=[x,y]
        F=y-x
e=abs(m[0]-M[0])+abs(m[1]-M[1])
ans=max(D-d,e)
print(ans)
N = int(input())
d = [[], []]
for i in range(N):
    x, y = map(int, input().split())
    d[0].append(x-y)
    d[1].append(x+y)

ans = 0
for i in range(2):
    ans = max(ans, max(d[i])-min(d[i]))
print(ans)
def resolve():
    N = int(input())
    _xmin, _xmax = float("inf"), -float("inf")
    _ymin, _ymax = float("inf"), -float("inf")
    for i in range(N):
        x, y = list(map(int, input().split()))
        _x, _y = x - y, x + y
        _xmin = min(_x, _xmin)
        _xmax = max(_x, _xmax)
        _ymin = min(_y, _ymin)
        _ymax = max(_y, _ymax)
    print(max(_xmax-_xmin, _ymax-_ymin))


if '__main__' == __name__:
    resolve()
n=int(input())
plus=[]
minus=[]
for i in range(n):
    x,y=map(int,input().split())
    plus.append(x+y)
    minus.append(x-y)
print(max(max(plus)-min(plus),max(minus)-min(minus)))
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    XY = [[int(x) for x in input().split()] for _ in range(N)]

    arr1 = []
    arr2 = []
    for x, y in XY:
        arr1.append(x - y)
        arr2.append(x + y)

    print(max(abs(max(arr1) - min(arr1)), abs(max(arr2) - min(arr2))))





if __name__ == '__main__':
    main()
n=int(input())
P=[]
M=[]
for i in range(n):
    x,y=map(int,input().split())
    P.append(x+y)
    M.append(x-y)
dP=abs(max(P)-min(P))
dM=abs(max(M)-min(M))
print(max(dP,dM))
N = int(input())
l = []
for i in range(N):
    l.append([int(x) for x in input().split()])

xlim = []
ylim = []

def cha(a):
    return [a[0]-a[1],a[0]+a[1]]

for i in range(N):
        ylim.append(cha(l[i])[1])
        xlim.append(cha(l[i])[0])

xlim.sort()
ylim.sort()

print(max(xlim[-1]-xlim[0],ylim[-1]-ylim[0]))
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    xy = list(nl() for _ in range(n))

    xpy = [x + y for x, y in xy]
    xmy = [x - y for x, y in xy]

    print(max(max(xpy) - min(xpy), max(xmy) - min(xmy)))


if __name__ == '__main__':
    main()
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
z = [x + y for x, y in xy]
w = [x - y for x, y in xy]
z.sort()
w.sort()

ans = max(z[-1] - z[0], w[-1] - w[0])
print(ans)
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
a=[]
b=[]
for i in range(n):
  a.append(l[i][0]+l[i][1])
  b.append(l[i][0]-l[i][1])
print(max(max(a)-min(a),max(b)-min(b)))
N = int(input())
A = []
B = []
for i in range(N):
    x,y = map(int,input().split())
    A.append(x+y)
    B.append(x-y)

a = max(A)
b = min(A)
c = max(B)
d = min(B)

ans = max(a-b,c-d)
print(ans)
N = int(input())
P = []
M = []
A = []

def dist(p1, p2):
  return abs(p1[0]-p2[0]) + abs(p1[1]-p2[1])

for i in range(N):
  x, y = map(int, input().split())
  P.append(x+y)
  M.append(x-y)
  A.append((x, y))

ans1 = dist(A[P.index(max(P))], A[P.index(min(P))])
ans2 = dist(A[M.index(max(M))], A[M.index(min(M))])

print(max(ans1, ans2))
def main():
  f_0 = []
  f_1 = []
  n = int(input())
  for i in range(n):
    x, y = map(int, input().split())
    f_0.append(x-y)
    f_1.append(x+y)
  print(max(max(f_0)-min(f_0),max(f_1)-min(f_1)))
  
if __name__ == "__main__":
  main()
n=int(input())
xy=[list(map(int,input().split())) for i in range(n)]
ans=[]
cand=[xy[i][0]+xy[i][1] for i in range(n)]
#print(cand)
ans.append(max(cand)-min(cand))
cand=[-xy[i][0]+xy[i][1]for i in range(n)]
ans.append(max(cand)-min(cand))
cand=[-xy[i][0]-xy[i][1] for i in range(n)]
ans.append(max(cand)-min(cand))
cand=[xy[i][0]-xy[i][1] for i in range(n)]
ans.append(max(cand)-min(cand))
print(max(ans))
n = int(input())
x = []
y = []
z = []
for i in range(n):
  a,b = map(int, input().split())
  x.append(a+b)
  y.append(a-b)
  z.append(b-a)
print(max(max(x) - min(x),max(y) - min(y),max(z) - min(z)))
N = int(input())
que= [[]for i in range(2)]
for i in range(N):
    x,y = map(int,input().split())
    que[0].append(x-y)
    que[1].append(x+y)
que[0].sort()
que[1].sort()
ans = max(que[0][-1]-que[0][0],que[1][-1]-que[1][0])
print(ans)
#!/usr/bin/env python3
(n,), *d = [[*map(int, o.split())] for o in open(0)]
M = [[x - y for x, y in d], [x + y for x, y in d]]
print(max(max(M[d]) - min(M[d]) for d in [0, 1]))
def main():
    N = int(input())
    p_list = [list(map(int, input().split())) for i in range(N)]

    z_list = []
    w_list = []
    for i in range(N):
        x = p_list[i][0]
        y = p_list[i][1]
        z_list.append(x + y)
        w_list.append(x - y)
    ans = max(max(z_list) - min(z_list), max(w_list) - min(w_list))
    print(ans)
    return


if __name__ == '__main__':
    main()
n = int(input())
p = [list(map(int, input().split())) for _ in range(n)]
for i, v in enumerate(p):
    x, y = v
    p[i] = x-y, x+y

xm, ym = -10**9, -10**9
xw, yw = 10**9, 10**9
for x, y in p:
    xm = max(xm, x)
    xw = min(xw, x)
    ym = max(ym, y)
    yw = min(yw, y)

# print(p)
ans = max(abs(xm - xw), abs(ym - yw))
print(ans)
def manhattan(n, x, y):
    x2 = [0] * n
    y2 = [0] * n
    for i in range(n):
        x2[i] = x[i] - y[i]
        y2[i] = x[i] + y[i]
    print(max(max(x2) - min(x2), max(y2) - min(y2)))

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i] , y[i] = map(int, input().split())
manhattan(n, x, y)
n = int(input())
a = []
b = []
for i in range(n):
  x,y = map(int, input().split())
  a.append(x+y)
  b.append(x-y)
a.sort()
b.sort()

ans = a[-1]-a[0]
c = b[-1]-b[0]
print (max(ans,c))
N = int(input())

x, y = map(int, input().split())
mz = Mz = x + y
mw = Mw = x - y

for i in range(N-1):
    x, y = map(int, input().split())
    z = x + y
    w = x - y
    mz = min(mz, z)
    Mz = max(Mz, z)
    mw = min(mw, w)
    Mw = max(Mw, w)

print(max(Mz-mz, Mw - mw))
n = int(input())
A = []
B = []
for i in range(n):
    a, b = map(int, input().split())
    z = a + b
    w = a - b
    A.append(z)
    B.append(w)
    
P = abs(max(A) - min(A))
Q = abs(max(B) - min(B))
print(max(P, Q))
import numpy as np

f = open(0)
N = int(f.readline())
xy = np.fromstring(f.read(), dtype=np.int64, sep=' ').reshape((-1, 2)).T.copy()
x = xy[0]
y = xy[1]
c1 = x + y
c2 = x - y
ans = max(c1.max() - c1.min(), c2.max() - c2.min())
print(ans)
def main():
    n = int(input())
    xy = [list(map(int, input().split())) for _ in [0]*n]
    z1 = [x+y for x, y in xy]
    z2 = [x-y for x, y in xy]
    z3 = [-x+y for x, y in xy]
    z4 = [-x-y for x, y in xy]
    print(max([max(z1)-min(z1), max(z2)-min(z2),
               max(z3)-min(z3), max(z4)-min(z4)]))


main()
n=int(input())
p=[]
q=[]
for _ in range(n):
  x,y=map(int,input().split())
  p.append(x+y)
  q.append(x-y)
print(max(max(p)-min(p),max(q)-min(q)))
n = int(input())
a, b = [], []
for _ in range(n):
    x, y = map(int, input().split())
    a.append(x+y)
    b.append(x-y)

a.sort()
b.sort()

ans = max(a[-1]-a[0], b[-1]-b[0])
print(ans)
def main():
    point_count = int(input())
    inf = 10 ** 10
    max_sum, min_sum, max_diff, min_diff = - inf, inf,  - inf, inf
    for _ in range(point_count):
        x, y = [int(x) for x in input().split()]
        max_sum = max(x + y, max_sum)
        min_sum = min(x + y, min_sum)
        max_diff = max(x - y, max_diff)
        min_diff = min(x - y, min_diff)
    return max(max_sum - min_sum, max_diff - min_diff)


if __name__ == '__main__':
    print(main())
N = int(input())
plus_max = -10**10
plus_min = 10**10
minus_max = -10**10
minus_min = 10**10
for i in range(N):
    x,y = map(int,input().split())
    plus_max = max(plus_max,x+y)
    plus_min = min(plus_min,x+y)
    minus_max = max(minus_max,x-y)
    minus_min = min(minus_min,x-y)
print(max(plus_max-plus_min,minus_max-minus_min))
n = int(input())
l, l2 = [], []
for i in range(n):
    x, y = map(int, input().split())
    l.append(x + y)
    l2.append(x - y)
print(max(max(l) - min(l), max(l2) - min(l2)))
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
XY = [list(mapint()) for _ in range(N)]
XY.sort(key=lambda x:x[0]+x[1])
ans_1 = abs(XY[0][0]-XY[-1][0])+abs(XY[0][1]-XY[-1][1])
XY.sort(key=lambda x:x[0]-x[1])
ans_2 = abs(XY[0][0]-XY[-1][0])+abs(XY[0][1]-XY[-1][1])
print(max(ans_1, ans_2))
n = int(input())
wa = [0]*n
sa = [0]*n
for i in range(n):
    x,y = map(int,input().split())
    wa[i] = x+y
    sa[i] = x-y
wanosa = max(wa) - min(wa)
sanosa = max(sa) - min(sa)
ans = max(wanosa,sanosa)
print(ans)
n = int(input())
maxda = -10**18
minda = 10**18
maxdb = -10**18
mindb = 10**18
for i in range(n):
	x,y = map(int,input().split())
	maxda = max(maxda, x-y)
	minda = min(minda, x-y)
	maxdb = max(maxdb, x+y)
	mindb = min(mindb, y+x)
print(max(maxda-minda, maxdb-mindb))
N=int(input())
Z=[0]*N
W=[0]*N

for i in range(N):
    x,y=map(int,input().split())
    Z[i]=x+y
    W[i]=x-y

alpha=max(Z)-min(Z)
beta=max(W)-min(W)
print(max(alpha,beta))
(N,) = [int(x) for x in input().split()]
XY = [[int(x) for x in input().split()] for i in range(N)]

best = 0

mn = min(XY, key=lambda pt: pt[0] + pt[1])
mx = max(XY, key=lambda pt: pt[0] + pt[1])
best = max(best, abs(mn[0] - mx[0]) + abs(mn[1] - mx[1]))

mn = min(XY, key=lambda pt: pt[0] - pt[1])
mx = max(XY, key=lambda pt: pt[0] - pt[1])
best = max(best, abs(mn[0] - mx[0]) + abs(mn[1] - mx[1]))


print(best)
n = int(input())
X = []
Y = []
for i in range(n):
    x,y = map(int,input().split())
    X.append(x+y)
    Y.append(x-y)

print(max(max(X)-min(X),max(Y)-min(Y)))
n=int(input())
xy=[list(map(int, input().split())) for _ in range(n)]
a1=0
a2=xy[0][0]+xy[0][1]
b1=xy[0][0]-xy[0][1]
b2=xy[0][0]-xy[0][1]
for i in range(n):
    res1=xy[i][0]+xy[i][1]
    res2=xy[i][0]-xy[i][1]
    a1=max(a1,res1)
    a2=min(a2,res1)
    b1=max(b1,res2)
    b2=min(b2,res2)
ans=max(a1-a2,b1-b2)
print(ans)
n=int(input())
fxy=[[] for _ in range(n)]
for i in range(n):
    x,y=map(int, input().split())
    fxy[i].append(x-y)
    fxy[i].append(x+y)
fxy.sort()
ans=fxy[-1][0]-fxy[0][0]
fxy.sort(key=lambda x: x[1])
ans=max(ans,fxy[-1][1]-fxy[0][1])
print(ans)
n, *XY = map(int, open(0).read().split())
X, Y = XY[::2], XY[1::2]
A = [x+y for x, y in zip(X, Y)]
B = [x-y for x, y in zip(X, Y)]
print(max(max(A) - min(A), max(B) - min(B)))
N = int(input())
X,Y = [],[]
def func(p):
    return p[0]-p[1], p[0]+p[1]
for _ in range(N):
    x,y = func(list(map(int,input().split())))
    X.append(x)
    Y.append(y)
ans = 0
ans = max(max(X)-min(X),max(Y)-min(Y))
print(ans)
n=int(input())
xy_1 = [0]*n
xy_2 = [0]*n
for i in range(n):
  x,y = map(int,input().split())
  xy_1[i] = x + y
  xy_2[i] = x - y

print(max(max(xy_1) - min(xy_1), max(xy_2)-min(xy_2)))
def main():
    point_count = int(input())
    sums = []
    diffs = []
    for _ in range(point_count):
        x, y = [int(x) for x in input().split()]
        sums.append(x + y)
        diffs.append(x - y)
    pat_sum = abs(max(sums) - min(sums))
    pat_diff = abs(max(diffs) - min(diffs))
    return max(pat_sum, pat_diff)


if __name__ == '__main__':
    print(main())
n = int(input())
amx = -float("inf")
amn = float("inf")
bmx = -float("inf")
bmn = float("inf")
ans = -float("inf")
for i in range(n):
    a,b = map(int,input().split())
    amx = max(amx,a+b)
    amn = min(amn,a+b)
    bmx = max(bmx,a-b)
    bmn = min(bmn,a-b)
print(max(amx-amn,bmx-bmn))
n = int(input())
z,w = [],[]
for _ in range(n):
  x,y = map(int,input().split())
  z.append(x+y)
  w.append(x-y)
print(max(max(z)-min(z),max(w)-min(w)))
n=int(input())

x=[]
y=[]

for i in range(n):
  s,t=map(int,input().split())
  x.append(s+t)
  y.append(s-t)

print(max(max(x)-min(x),max(y)-min(y)))
n = int(input())
lst_plus = []
lst_minus = []

for i in range(n):
  x,y = map(int,input().split())
  lst_plus.append(x+y)
  lst_minus.append(y-x)
  
lst_plus.sort()
lst_minus.sort()

A = lst_plus[-1] - lst_plus[0]
B = lst_minus[-1] - lst_minus[0]

print(max([A,B]))
N = int(input())
xys =[list(map(int, input().split())) for _ in range(N)] 

ws = [x+y for x,y in xys]
zs = [x-y for x,y in xys]

print(max([max(ws)-min(ws), max(zs)-min(zs)]))
N = int(input())
z = []
zz = []
for _ in range(N):
    x, y = map(int, input().split())
    zz.append(x-y)
    z.append(x+y)
z.sort()
zz.sort()
ans = z[-1]-z[0]
ans = max(ans, zz[-1]-zz[0])

print(ans)
def solve():
    N = int(input())
    xy_l = [None] * N
    invxy_l = [None] * N
    for _ in range(N):
        _x, _y = map(int, input().split())
        xy_l[_] = _x + _y - 2
        invxy_l[_] = _y - 1 - (_x - 1)

    ans_a = max(xy_l) - min(xy_l)
    ans_b = max(invxy_l) - min(invxy_l)

    if ans_a > ans_b:
        print(ans_a)
    else:
        print(ans_b)


solve()
X = []
Y = []
N = int(input())
for i in range(N):
  x, y = map(int, input().split())
  X.append(x + y)
  Y.append(x - y)

ans = max(max(X)-min(X), max(Y)-min(Y))
print(ans)
n = int(input())
xy = [list(map(int, input().split())) for _i in range(n)]
x = [i+j for i, j in xy]
y = [i-j for i, j in xy]
x.sort()
y.sort()
print(max(abs(x[0]-x[-1]), abs(y[0]-y[-1])))
def main():
  n = int(input())
  a_li , b_li = [] , []
  for _ in range(n):
    x , y = map(int,input().split())
    a_li.append(x + y)
    b_li.append(x - y)
  print(max(max(a_li) - min(a_li), max(b_li) - min(b_li)))
 
if __name__ == "__main__":
  main()
n = int(input())
XY = [tuple(map(int, input().split())) for i in range(n)]
A = [x + y for x, y in XY]
B = [x - y for x, y in XY]
print(max(max(A) - min(A), max(B) - min(B)))
n = int(input())
p = []
for i in range(n):
    x,y = map(int,input().split())
    p.append([x,y])
q = []
r = []
for i in range(n):
    q.append(p[i][0]+p[i][1])
    r.append(p[i][0]-p[i][1])
q.sort()
r.sort()
ans = max(abs(q[-1]-q[0]),abs(r[-1]-r[0]))
print(ans)
import sys
input = sys.stdin.readline
n = int(input())
xy = tuple(map(int, input().split()))
pM = sum(xy)
pm = sum(xy)
mM = xy[0] - xy[1]
mm = xy[0] - xy[1]
for _ in range(n - 1):
    xy = tuple(map(int, input().split()))
    s = sum(xy)
    d = xy[0] - xy[1]
    if s > pM:
        pM = s
    elif s < pm:
        pm = s
    if d > mM:
        mM = d
    elif d < mm:
        mm = d
print(max(abs(pM - pm), abs(mM - mm)))
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
ans = 0
ur = sorted(xy, key=lambda x: x[0]+x[1])[-1]
ul = sorted(xy, key=lambda x: x[1]-x[0])[-1]
dr = sorted(xy, key=lambda x: x[0]-x[1])[-1]
dl = sorted(xy, key=lambda x: -x[0]-x[1])[-1]

l = [ur, ul, dr, dl]
for i in l:
  for j in l:
    ans = max(ans, abs(i[0]-j[0])+abs(i[1]-j[1]))
print(ans)
N = int(input())
x, y = map(int, input().split())
d = [x - y, x - y, x + y, x + y]
for i in range(1,N):
  x, y = map(int, input().split())
  d[0] = max(d[0], x-y)
  d[1] = min(d[1], x-y)
  d[2] = max(d[2], x+y)
  d[3] = min(d[3], x+y)
print(max(d[0]-d[1], d[2]-d[3]))
def main():
    n = int(input())
    xym, xyM, x_ym, x_yM = 10**9, -10**9, 10**9, -10**9
    for _ in range(n):
        x, y = map(int, input().split())
        xy, x_y = x+y, x-y
        xym, xyM, x_ym, x_yM = min(xym, xy), max(xyM, xy), min(x_ym, x_y), max(x_yM, x_y)
    print(max(xyM-xym, x_yM-x_ym))

if __name__ == "__main__":
    main()
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    a0 = a1 = a2 = a3 = INF

    ans = 0
    for _ in range(int(input())):
        x, y = map(int, input().split())
        ans = max(ans, x + y - a0, x - y - a1, -x + y - a2, -x - y - a3)
        a0 = min(a0, x + y)
        a1 = min(a1, x - y)
        a2 = min(a2, -x + y)
        a3 = min(a3, -x - y)

    print(ans)
resolve()
N = int(input())
X = []
Y = []
for _ in range(N):
    x, y = list(map(int, input().split()))
    X.append(x)
    Y.append(y)
    
points = []
for x, y in zip(X, Y):
    points.append((
        x + y,
        x - y
    ))
print(max(max(dim) - min(dim) for dim in zip(*points)))
n=int(input())
r=[]
for _ in range(n):
    a,b=map(int,input().split())
    r.append([a+b,a-b])
r=list(zip(*r))
print(max(max(r[0])-min(r[0]),max(r[1])-min(r[1])))
N = int(input())
points = []
for _ in range(N):
    points.append([int(s) for s in input().split()])
def dist(x, y):
    return abs(x[0] - y[0]) + abs(x[1] - y[1])
points.sort(key=lambda x: x[0] + x[1])
d1 = dist(points[0], points[-1])
# print(points)
points.sort(key=lambda x: x[0] - x[1])
d2 = dist(points[0], points[-1])
# print(points)
print(max(d1, d2))
N = int(input())

ans = 0
x, y = map(int, input().split())
Max_A = x+y
Min_A = x+y
Max_B = -x+y
Min_B = -x+y

for i in range(1,N):
  x, y = map(int, input().split())
  C = x + y
  D = -x + y
  temp = max( abs(Max_A-C), abs(Min_A-C), abs(Max_B-D), abs(Min_B-D) )
  ans = max(ans, temp)
  #print(C, D, ans)
  Max_A = max(Max_A, C)
  Max_B = max(Max_B, D)
  Min_A = min(Min_A, C)
  Min_B = min(Min_B, D)

print(ans)
n, *XY = map(int, open(0).read().split())
X, Y = XY[::2], XY[1::2]
A = [x+y for x, y in zip(X, Y)]
B = [x-y for x, y in zip(X, Y)]
A.sort()
B.sort()
print(max(A[-1] - A[0], B[-1] - B[0]))
N = int(input())

lst = [list(map(int, input().split())) for _ in range(N)]

max_1 = -float('inf')
min_1 = float('inf')

max_2 = -float('inf')
min_2 = float('inf')

for a, b in lst:
    max_1 = max(max_1, a - b)
    min_1 = min(min_1, a - b)

    max_2 = max(max_2, a + b)
    min_2 = min(min_2, a + b)


ans = max(max_1 - min_1, max_2 - min_2)

print(ans)
n = int(input())
X = []
Y = []
for i in range(n):
    x,y = map(int, input().split())
    x,y = x-y,x+y
    X.append(x)
    Y.append(y)

a = max(Y) - min(Y)
b = max(X) - min(X)

print(max(a,b))
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))

n = int(input())
point = []
p = []
m = []
for i in range(n):
    a,b = mp()
    point.append((a,b))
    p.append(a+b)
    m.append(a-b)
print(max(max(p)-min(p), -min(m)+max(m), max(m)-min(m), -min(p)+max(p)))
n = int(input())
a = []; b = []
for i in range(n):
    x, y = map(int, input().split())
    a.append(x+y); b.append(x-y)
print(max(max(a)-min(a), max(b)-min(b)))
n = int(input())
ans = 0
ma1, mi1 = -10000000000, 10000000000
ma2, mi2 = -10000000000, 10000000000
for i in range(n):
    x, y = map(int, input().split())
    ma1 = max(ma1, x - y)
    mi1 = min(mi1, x - y)
    ma2 = max(ma2, x + y)
    mi2 = min(mi2, x + y)
    ans = max(ans, ma1 - mi1, ma2 - mi2)
print(ans)
from sys import stdin
readline = stdin.readline
def i_input(): return int(readline().rstrip())
def i_map(): return map(int, readline().rstrip().split())
def i_list(): return list(i_map())


def main():
    N = i_input()
    Z = []
    W = []
    for i in range(1, N + 1):
        x, y = i_map()
        Z.append(x + y)
        W.append(x - y)
    Z.sort()
    W.sort()
    ans = max([Z[-1] - Z[0], W[-1] - W[0]])
    print(ans)

if __name__ == "__main__":
    main()
import sys
input = sys.stdin.readline
n = int(input())
C = [list(map(int,input().split())) for i in range(n)]

a = 2*10**9+5
b = -2*10**9+5
c = 2*10**9+5
d = -2*10**9+5

for i in range(n):
    a = min(a, C[i][0]+C[i][1])
    b = max(b, C[i][0]+C[i][1])
    c = min(c, C[i][0]-C[i][1])
    d = max(d, C[i][0]-C[i][1])

print(max(b-a,d-c))
import sys
 
 
def f(x, y):
    return x - y, x + y
 
 
def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    x = [0] * n
    y = [0] * n
    for i in range(n):
        x[i], y[i] = map(int, input().split())
    f0 = [0] * n
    f1 = [0] * n
    for i in range(n):
        f0[i], f1[i] = f(x[i], y[i])
    print(max(max(f0) - min(f0), max(f1) - min(f1)))
 
 
if __name__ == "__main__":
    main()
N = int(input())

a = [0 for i in range(N)]
b = [0 for i in range(N)]

for i in range(N):
  x, y = list(map(int, input().split()))
  a[i] = x + y
  b[i] = x - y

a = sorted(a)
b = sorted(b)
print(max(a[N-1]-a[0], b[N-1]-b[0]))
#E
N=int(input())
x=[0 for i in range(N)]
y=[0 for i in range(N)]

Cx=[0 for i in range(N)]
Cy=[0 for i in range(N)]

for i in range(N):
    x[i],y[i]=map(int,input().split())
    Cx[i]=x[i]+y[i]
    Cy[i]=x[i]-y[i]
    
ans=max(max(Cx)-min(Cx),max(Cy)-min(Cy))
print(ans)