peterverebics/CodeNet_Python_118 huggingface dataset:
n = int(input())
ph = 0
pl = 10**10
mh = -10**10
ml = 10**10
for _ in range(n):
  x,y = map(int,input().split())
  ph = max(ph,x+y)
  pl = min(pl,x+y)
  mh = max(mh,x-y)
  ml = min(ml,x-y)
print(max(ph-pl,mh-ml))
n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]

xy1 = []
xy2 = []

for x,y in xy:
    xy1.append(x+y)
    xy2.append(x-y)

xy1.sort()
xy2.sort()

print(max(xy1[-1] - xy1[0], xy2[-1] - xy2[0]))
import sys
def input():
	return sys.stdin.buffer.readline()[:-1]

n = int(input())
d = [list(map(int, input().split())) for _ in range(n)]
ans1 = max(x[0] + x[1] for x in d) - min(x[0] + x[1] for x in d)
ans2 = max(x[0] - x[1] for x in d) - min(x[0] - x[1] for x in d)
print(max(ans1, ans2))
import sys

input = sys.stdin.readline

def main():
    N = int(input())
    Z = []; W = []
    for i in range(N):
        x, y = map(int, input().split())
        z = x + y
        w = x - y
        Z.append(z)
        W.append(w)
    ans = max(max(Z) - min(Z), max(W) - min(W))
    print(ans)

if __name__ == "__main__":
    main()
N=int(input())
minz=10**11
minw=10**11
maxz=-10**11
maxw=-10**11
for i in range(N):
 
    a,b=map(int,input().split())
    if  a+b>maxz:
        maxz=a+b

    if a+b<minz:
        minz=a+b

    if  a-b>maxw:
        maxw=a-b

    if a-b<minw:
        minw=a-b

    
 
print(max((maxz-minz),(maxw-minw)))
n = int(input())
XY = [tuple(map(int, input().split())) for _ in range(n)]

# 左下右上
mi = min(XY, key=lambda x: x[0] + x[1])
ma = max(XY, key=lambda x: x[0] + x[1])
ans1 = ma[0]-mi[0] + ma[1]-mi[1]

# 左上右下
mi = min(XY, key=lambda x: x[0] + (10**9)-x[1])
ma = min(XY, key=lambda x: (10**9)-x[0] + x[1])
ans2 = abs(ma[0]-mi[0]) + abs(ma[1]-mi[1])
print(max(ans1, ans2))
n=int(input())
lx=[]
ly=[]
for i in range(n):
  x,y=map(int,input().split())
  lx.append(x+y)
  ly.append(x-y)
ax,bx,ay,by=max(lx),min(lx),max(ly),min(ly)
print(max(ax-bx,ay-by))
n = int(input())
pnts = [tuple(map(int, input().split())) for i in range(n)]

mxsum = max(map(lambda p: p[0]+p[1], pnts))
mnsum = min(map(lambda p: p[0]+p[1], pnts))
mxdif = max(map(lambda p: p[0]-p[1], pnts))
mndif = min(map(lambda p: p[0]-p[1], pnts))

print(max([mxsum - mnsum, mxdif-mndif]))
import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))

n = ri()
a = []
b = []
for i in range(n):
    x,y = rl()
    a.append(x+y)
    b.append(x-y)
a.sort()
b.sort()
print(max(a[-1]-a[0], b[-1]-b[0]))
def main():
    n = int(input())
    
    z = []
    w = []

    for _ in range(n):
        x,y = tuple(map(int,input().split()))
        z.append(x+y)
        w.append(x-y)

    print(max(max(z)-min(z),max(w)-min(w)))

if __name__ == "__main__":
    main()
n=int(input())
tens=[]
for i in range(n):
    x,y=map(int,input().split())
    tens.append([x,y])

tasu=[]
hiku=[]

for i in range(n):
    tasu.append(tens[i][0]+tens[i][1])
    hiku.append(tens[i][0]-tens[i][1])

#print(tasu,hiku)

a=max(tasu)-min(tasu)
b=max(hiku)-min(hiku)

print(max(a,b))
n = int(input())
x, y = map(int, input().split())
p, m = [x+y]*2, [x-y]*2
for i in range(n-1):
    x, y = map(int, input().split())
    p = [min(p[0], x+y), max(p[1], x+y)]
    m = [min(m[0], x-y), max(m[1], x-y)]
print(max(p[1] - p[0], m[1] - m[0]))
n=int(input())
alist=[]
blist=[]
for i in range(n):
  x,y=map(int, input().split())
  alist.append(x+y)
  blist.append(x-y)
print(max(max(alist)-min(alist),max(blist)-min(blist)))
# -*- coding: utf-8 -*-
N = int(input())
pos_x_list = []
pos_y_list = []

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

print(max(max(pos_x_list) - min(pos_x_list), max(pos_y_list) - min(pos_y_list)))
def get_ints():
  return list(map(int,input().split()))

n = int(input())
a,b = [],[]
for i in range(n):
  x,y = get_ints()
  a.append(x+y)
  b.append(x-y)

a.sort()
b.sort()
ans = max(a[-1]-a[0], b[-1]-b[0])
print(ans)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
xy = [tuple(map(int, input().split())) for _ in range(n)]
l = [(item[0]+item[1], item[0]-item[1]) for item in xy]
l.sort()
v0 = l[-1][0]-l[0][0]
l.sort(key=lambda x: x[1])
v1 = l[-1][1]-l[0][1]
ans = max(v0,v1)
print(ans)
n = int(input())
a = [0] * n
b = [0] * n
for i in range(n):
  p, q = [int(j) for j in input().split(' ')]
  a[i] = p+q
  b[i] = p-q

a.sort()
b.sort()
print(max(a[-1] - a[0], b[-1] - b[0]))
n=int(input())
l=[]
ll=[]
for i in range(n):
  x,y=map(int,input().split())
  l.append(x+y)
  ll.append(x-y)

l.sort()
ll.sort()

print(max(l[-1]-l[0],ll[-1]-ll[0]))
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=sorted(a)
b=sorted(b)
ans=max(a[-1]-a[0],b[-1]-b[0])
print(ans)
import random

N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
  x[i], y[i] = map(int, input().split())

minn = 10**10
maxn = -10**10
minp = 10**10
maxp = -10**10

for i in range(N):
  minn = min(minn, x[i]-y[i])
  maxn = max(maxn, x[i]-y[i])
  minp = min(minp, x[i]+y[i])
  maxp = max(maxp, x[i]+y[i])

print(max(maxn-minn, maxp-minp))
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
a=10**9
z_max=-1*a
z_min=a
w_max=-1*a
w_min=a
for x,y in l: #点のx座標とy座標の和の最大値と最小値の差か座標の差の最大値と最小値の差が答え
  z_max=max(z_max,x+y)
  z_min=min(z_min,x+y)
  w_max=max(w_max,x-y)
  w_min=min(w_min,x-y)
print(max(z_max-z_min,w_max-w_min))
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)-min(a)
B = max(b)-min(b)
print(max(A,B))
N=int(input())


Sum=[]
Sub=[]
for _ in range(N):
    x,y = map(int,input().split())
    Sum.append(x+y)
    Sub.append(x-y)

Sum = sorted(Sum)
Sub=sorted(Sub)
ans=max(abs(Sum[-1]-Sum[0]),abs(Sub[-1]-Sub[0]))
print(ans)
N = int(input())
z =[]
w = []
for i 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)))
import sys
N=int(sys.stdin.readline().strip())
XY=[ map(int, sys.stdin.readline().split()) for _ in range(N) ]
X=[]
Y=[]
for x,y in XY:
    X.append(x-y)
    Y.append(x+y)
X.sort()
Y.sort()
print max(abs(X[0]-X[-1]),abs(Y[0]-Y[-1]))
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

mx = 9
L = [0] * N
for i in range(N):
  x, y = xy[i]
  L[i] = x + y
  mx = max(mx, x)

L.sort()
ans = L[-1] - L[0]

for i in range(N):
  x, y = xy[i]
  L[i] = mx - x + y

L.sort()
ans = max(ans, L[-1] - L[0])

print(ans)
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())
ans=[]
a=[]
b=[]
c=[]
d=[]
for i in range(n):
    x,y=map(int,input().split())
    a.append(x-y)
    b.append(x+y)
a=sorted(a)
b=sorted(b)
ans=[a[-1]-a[0],b[-1]-b[0]]
print(max(ans))
pnt=[]
n=int(input())
for i in range(n):
  pnt.append(list(map(int,input().split())))

z=[]
w=[]

for i in pnt:
  z.append(i[0]+i[1])
  w.append(i[0]-i[1])
print(max(max(z)-min(z),max(w)-min(w)))
N = int(input())
xy = [map(int, input().split()) for _ in range(N)]


def get_output():
    dist = [0 for _ in range(N)]
    X, Y = [], []

    for i, (x, y) in enumerate(xy):
        x, y = x-y, x+y
        X.append(x)
        Y.append(y)

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


print(get_output())
n = int(input())

plus,minus = [],[]
for i in range(n):
    a,b = map(int,input().split())
    plus.append(a+b)
    minus.append(a-b)

plus.sort()
minus.sort()

print(max(plus[-1]-plus[0],minus[-1]-minus[0]))
N=int(input())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
for i in range(N):
    x[i],y[i]=map(int,input().split())
A=[(x[i],y[i]) for i in range(N)]
B=[(x[i],y[i]) for i in range(N)]
A.sort(key=lambda p:p[0]+p[1])
B.sort(key=lambda p:p[0]-p[1])
def dist(a,b):
    return abs(a[0]-b[0])+abs(a[1]-b[1])
ans0=dist(A[0],A[-1])
ans1=dist(B[0],B[-1])
print(max(ans0,ans1))
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)
    X.sort()
    Y.sort()
    print(max(X[-1] - X[0], Y[-1] - Y[0]))

if __name__ == '__main__':
    main()
N = int(input())
A = [[int(a) for a in input().split()] for _ in range(N)]
for i in range(N):
    z = A[i][0] + A[i][1]
    w = A[i][0] - A[i][1]
    if i==0:
        M_z = m_z = z
        M_w = m_w = w
    if z > M_z: M_z = z
    if z < m_z: m_z = z
    if w > M_w: M_w = w
    if w < m_w: m_w = w
print(max(M_z-m_z,M_w-m_w))
def f(x, y):
    return x-y, x+y


n = int(input())
p = [list(map(int, input().split())) for i in range(n)]

max_x = -2000000000
min_x = 2000000000
max_y = -2000000000
min_y = 2000000000
for xi, yi in p:
    f1, f2 = f(xi, yi)
    max_x = max(max_x, f1)
    min_x = min(min_x, f1)
    max_y = max(max_y, f2)
    min_y = min(min_y, f2)

print(max(max_x - min_x, max_y - min_y))
#!/usr/bin/env python3


def get_points_and_convert(pts):
    x, y = pts
    return x + y, x - y


def main():
    n = int(input())
    points = [
        get_points_and_convert(map(int, input().split()))
        for _ in range(n)
    ]
    plus_coords, minus_coords = list(zip(*points))
    plus_dist = max(plus_coords) - min(plus_coords)
    minus_dist = max(minus_coords) - min(minus_coords)
    print(max(plus_dist, minus_dist))


if __name__ == '__main__':
    main()
import numpy as np
a = input()
N = int(a)

xy = [map(int, input().split()) for _ in range(N)]
x, y = np.array([list(i) for i in zip(*xy)])

z = x + y
w = x - y

ans = max((max(z)-min(z)),(max(w)-min(w)))
print(ans)
n=int(input())

a=[]
b=[]
for i in range(n):
  x,y=map(int,input().split())
  a.append([x+y,x,y])
  b.append([x-y,x,y])
a.sort()
b.sort()
ans=abs(a[0][1]-a[n-1][1])+abs(a[0][2]-a[n-1][2])
aa=abs(b[0][1]-b[n-1][1])+abs(b[0][2]-b[n-1][2])
print(max(ans,aa))
n = int(input())
point_dict1 = {}
point_dict2 = {}
for i in range(n):
    x, y = map(int, input().split())
    point_dict1[x + y] = (x, y)
    point_dict2[y - x] = (x, y)
min_point1 = min(point_dict1)
max_point1 = max(point_dict1)
min_point2 = min(point_dict2)
max_point2 = max(point_dict2)
print(max(max_point1 - min_point1, max_point2 - min_point2))
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)))
import sys
input = sys.stdin.readline
N = int(input())
XY = [tuple(map(int,input().split())) for i in range(N)]

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

a = max(A) - min(A)
b = max(B) - min(B)
print(max(a,b))
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
Z = sorted([x+y for x,y in A])
W = sorted([x-y for x,y in A])

print(max(Z[-1]-Z[0], W[-1]-W[0]))
def main():
    # start coding here...
    N = int(input())
    a = []
    b = []
    for i in range(N):
        x,y = map(int,input().split())
        a.append(x+y)
        b.append(x-y)
    ans = max(max(a)-min(a),max(b)-min(b))
    print(ans)


if __name__ == "__main__":
    main()
#!/usr/bin/env python

n = int(input())
x_plus_y = [0 for _ in range(n)]
x_minus_y = [0 for _ in range(n)]
for i in range(n):
    x, y = map(int, input().split())
    x_plus_y[i] = x+y 
    x_minus_y[i] = x-y 

ans = max(max(x_plus_y)-min(x_plus_y), max(x_minus_y)-min(x_minus_y))
print(ans)
N = int(input())
points = [list(map(int, input().split())) for _ in range(N)]
INF = 10**10
xmax = -INF
xmin = INF
ymax = -INF
ymin = INF
for x, y in points:
  minus = x-y
  plus = x+y
  xmax = max(xmax, minus)
  xmin = min(xmin, minus)
  ymax = max(ymax, plus)
  ymin = min(ymin, plus)
print(max(xmax-xmin, ymax-ymin))
def main():
    N = int(input())
    X = []
    Y = []

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

    ans = max(max(X) - min(X), max(Y) - min(Y))
    print(ans)


if __name__ == '__main__':
    main()
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

a = max(z)
b = min(z)
c = max(w)
d = min(w)

print(max(a-b, b-a, c-d, d-c))
#E_Manhattan
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 = max(a[-1]-a[0], b[-1]-b[0])
print(ans)
N = int(input())
plus = []
minus = []
for _ 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)))
N = int(input())
xy = []
for i in range(N):
    xy.append(list(map(int, input().split())))


def f(x, y):
    return [x - y, x + y]


XY = []
for x, y in xy:
    XY.append(f(x, y))

large, small = [-float('inf'), -float('inf')], [float('inf'), float('inf')]
for i in range(2):
    for j in XY:
        large[i] = max(j[i], large[i])
        small[i] = min(j[i], small[i])

ans = max(large[0] - small[0], large[1] - small[1])
print(ans)
n = int(input())

X_min = float("inf")
X_max = -float("inf")
Y_min = float("inf")
Y_max = -float("inf")

for _ in range(n):
    x, y = map(int, input().split())
    X = x - y
    Y = x + y
    X_min = min(X_min, X)
    X_max = max(X_max, X)
    Y_min = min(Y_min, Y)
    Y_max = max(Y_max, Y)

print(max(X_max-X_min, Y_max-Y_min))
import sys
input = sys.stdin.readline

N=int(input())
P=[tuple(map(int,input().split())) for i in range(N)]

PLUS=[]
MINUS=[]

for x,y in P:
    PLUS.append(x+y)
    MINUS.append(x-y)

PLUS.sort()
MINUS.sort()

print(max(PLUS[-1]-PLUS[0],MINUS[-1]-MINUS[0]))
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()

print(max(A[N-1]-A[0],abs(B[N-1]-B[0])))
def get_ints():
    return list(map(int, input().split()))

n = int(input())
a,b = [],[]
for i in range(n):
    x, y = get_ints()
    a.append(x+y)
    b.append(x-y)

a.sort()
b.sort()
ans = max(a[-1]-a[0], b[-1]-b[0])
print(ans)
N = int(input())
L = [[int(l) for l in input().split()] for _ in range(N)]

L1 = [0]*N
L2 = [0]*N
for i in range(N):
    L1[i] = L[i][0]+L[i][1]
    L2[i] = L[i][0]-L[i][1]

L1.sort()
L2.sort()
print(max(L1[-1]-L1[0], L2[-1]-L2[0]))
import math

n = int(input())

x = list(range(n))
y = list(range(n))
m = list(range(n))
l = list(range(n))
for i in range(n):
  x[i],y[i] = map(int,input().split())
  m[i] = x[i] - y[i]
  l[i] = x[i] + y[i]
m.sort()
l.sort()
res = max(m[n-1]-m[0], l[n-1]-l[0])
print(res)
m,*p=[],
for i in [*open(0)][1:]:x,y=map(int,i.split());m+=x-y,;p+=x+y,
a=max;print(a(a(m)-min(m),a(p)-min(p)))
n = int(input())
pmax = 0
pmin = 0
mmax = 0
mmin = 0
for i in range(n):
    x, y = map(int, input().split())
    if(i ==0 or pmax < x + y):
        pmax = x+y
    if(i == 0 or pmin > x+y):
        pmin = x+y
    if(i == 0 or mmax < x-y):
        mmax = x-y
    if(i == 0 or mmin > x-y):
        mmin = x-y
print(max(pmax - pmin, mmax - mmin))
import numpy as np
def solve(n, x, y):
    x = np.asarray(x)
    y = np.asarray(y)
    z = x + y
    w = x - y
    return max(np.max(z) - np.min(z), np.max(w) - np.min(w))

n = int(input())
x, y = zip(*[map(int, input().split()) for i in range(n)])
print(solve(n, x, y))
import sys
import math,bisect
sys.setrecursionlimit(10 ** 5)
from collections import defaultdict
from itertools import groupby,accumulate
from heapq import heapify,heappop,heappush
from collections import deque,Counter,OrderedDict
def I(): return int(sys.stdin.readline())
def neo(): return map(int, sys.stdin.readline().split())
def Neo(): return list(map(int, sys.stdin.readline().split()))
n = I()
A,B = [],[]
for i in range(n):
    a,b = neo()
    A += [a+b]
    B += [a-b]
A.sort()
B.sort()
Ans = max(A[-1]-A[0],B[-1]-B[0])
print(Ans)
n = int(input())
pointx = []
pointy = []
for i in range(n):
    x, y = map(int, input().split())
    pointx.append(x-y)
    pointy.append(x+y)

print(max(max(pointx)-min(pointx),(max(pointy)-min(pointy))))
import sys
input = sys.stdin.readline
N = int(input())
mn = 10 ** 10
mx = -10 ** 10
mn2 = 10 ** 10
mx2 = -10 ** 10
qs = [tuple(map(int, input().split())) for _ in range(N)]
qs.sort()
for i in range(N):
  x, y = qs[i]
  mn = min(mn, x + y)
  mx = max(mx, x + y)
  mn2 = min(mn2, x - y)
  mx2 = max(mx2, x - y)
print(max(abs(mx2 - mn2), abs(mx - mn)))
def LI():
    return list(map(int, input().split()))


pu = []
mi = []
N = int(input())
for _ in range(N):
    x, y = LI()
    pu.append(x+y)
    mi.append(x-y)
P = max(pu)
p = min(pu)
M = max(mi)
m = min(mi)
print(max(P-p, M-m))
n = int(input())

x_max = 0
y_max = 0
x_min = 10**9
y_min = 10**9

p_arr = [0]*n
m_arr = [0]*n

for i in range(n):
  x, y = map(int, input().split())
  p_arr[i] = x + y
  m_arr[i] = x - y
  

p_dist = max(p_arr) - min(p_arr)
m_dist = max(m_arr) - min(m_arr)
dist_max = max(p_dist, m_dist)
  
  
print(dist_max)
n = int(raw_input())
points = set([])
for _ in range(n):
	p = map(int, raw_input().split())
	points.add(tuple(p))
points = list(points)
def distance(p,q): return abs(p[0] - q[0]) + abs(p[1] - q[1])


def f(points):
	r = 0
	for u in [-1,1]:
		for v in [-1,1]:
			pps = [u*x + v*y for x,y in points]
			r = max(r, max(pps) - min(pps))
	return r
print f(points)
n = int(input())
xy  = [list(map(int, input().split())) for _ in range(n)]

xy.sort()
lstm = []
lstp = []
for x, y in xy:
    lstm.append(x-y)
    lstp.append(x+y)
    
lstm.sort()
lstp.sort()
ans = max(lstm[-1] - lstm[0], lstp[-1] - lstp[0])
print(ans)
n = int(input())
p = [list(map(int, input().split())) for _ in range(n)]
q = [[x+y, x-y] for x, y in p]
print(max(max(q)[0] - min(q)[0], max(q, key=lambda x: x[1])[1] - min(q, key=lambda x: x[1])[1]))
n=int(input())
INF=float('inf')

cmin0,cmax0=INF,-INF
cmin1,cmax1=INF,-INF
for _ in range(n):
  x,y=map(int,input().split())
  cx,cy=x-y,x+y
  cmin0=min(cmin0,cx)
  cmax0=max(cmax0,cx)
  cmin1=min(cmin1,cy)
  cmax1=max(cmax1,cy)
  
ans=max(cmax0-cmin0,cmax1-cmin1)
print(ans)
n = int(input())
xyl = [tuple(map(int, input().split())) for _ in range(n)]

xyp = []
xym = []

for x,y in xyl:
    xyp.append(x+y)
    xym.append(x-y)

# xyp.sort()
# xym.sort()

ans1 = max(xym)-min(xym)
# print(ans1)
ans2 = max(xyp)-min(xyp)
ans = max(ans1,ans2)
print(ans)
N = int(input())
xy = [tuple(map(int, input().split())) for _ in range(N)]
z = []; w = []
for x, y in xy:
    z.append(x + y)
    w.append(x - y)

print(max(max(z)-min(z), max(w)-min(w)))
N = int(input())
px = []
py = []
cro1 = []
cro2 = []
for i in range(N):
    x,y = map(int,input().split())
    px.append((x,y))
    py.append((x,y))
    cro1.append(x+y)
    cro2.append(y-x)
"""
px.sort()
py.sort(key=lambda x:x[1])
"""
cro1.sort()
cro2.sort()
print(max(cro1[-1]-cro1[0],cro2[-1]-cro2[0]))
import sys

n = int(sys.stdin.buffer.readline())
z, w = [0]*n, [0]*n
for a, i in zip(sys.stdin.buffer.readlines(), range(n)):
    x, y = map(int, a.split())
    z[i] = x+y
    w[i] = x-y
print(max(abs(max(z)-min(z)), abs(max(w)-min(w))))
n = int(input())
p = []
m = []
for i in range(n):
    x, y = map(int, input().split())
    p.append(x+y)
    m.append(x-y)
p.sort()
m.sort()
print(max(p[-1]-p[0], m[-1]-m[0]))
n=int(input())
a=[]
j=k=0
def s(a):
    return a[0]+a[1]
def ss(a):
    return a[0]-a[1]
for i in range(n):
    f=list(map(int,input().split()))
    a.append(f)
aa=min(map(s,a))
b=max(map(s,a))
c=min(map(ss,a))
d=max(map(ss,a))
print(max(abs(d-c),abs(b-aa)))
n = int(input())
u = [list(map(int, input().split())) for i in range(n)]
z = [u[i][0] + u[i][1] for i in range(n)]
w = [u[i][0] - u[i][1] for i in range(n)]
d = [max(z)-min(z), max(w)-min(w)]

print(max(d))
x=[];y=[]
for _ in range(int(input())):
  a,b=map(int,input().split())
  x.append(a-b);y.append(a+b)
print(max(max(x)-min(x),max(y)-min(y)))
N = int(input())
pulls = []
minus = []

for _ in range(N):
    x, y = map(int, input().split())
    pulls += [x+y]
    minus += [x-y]

pulls.sort()
minus.sort()
print(max(pulls[-1] - pulls[0], minus[-1] - minus[0]))
import sys

readline = sys.stdin.readline
N = int(readline())
A = []
B = []
for _ in range(N):
    x, y = map(int, readline().split())
    A.append(x-y)
    B.append(x+y)
print(max(max(A) - min(A), max(B) - min(B)))
n = int (input())

xy = []

def dist(a, b):
    return abs(a[0]-b[0]) + abs(a[1]-b[1])
    
for i in range(n):
    x, y = map(int,input().split())
    xy.append([x+y, x-y])

xy.sort(key = lambda x: x[0])

min_z = xy[0][0]
max_z = xy[-1][0]

xy.sort(key = lambda x: x[1])

min_w = xy[0][1]
max_w = xy[-1][1]

print(max(abs(min_z - max_z), abs(min_w - max_w)))
N = int(input())
XYs = [[],[]]
for _ in range(N):
  x,y = map(int, input().split())
  XYs[0].append(x-y)
  XYs[1].append(x+y)
  
print(max(max(XYs[0])-min(XYs[0]), max(XYs[1])-min(XYs[1])))
n = int(input())
xpy_max = -1001001001
xpy_min =  1001001001
xmy_max = -1001001001
xmy_min =  1001001001

for i in range(n):
    x, y = map(int, input().split())
    xpy_max = max(xpy_max, x+y)
    xpy_min = min(xpy_min, x+y)
    xmy_max = max(xmy_max, x-y)
    xmy_min = min(xmy_min, x-y)
ans = max(xpy_max - xpy_min, xmy_max - xmy_min)
print(ans)
import sys
input = sys.stdin.readline

N = int(input())
xy = []
xs = []
ys = []
for _ in range(N):
    x, y = map(int, input().split())
    xy.append([x - y, x + y])
    xs.append(x - y)
    ys.append(x + y)

diff1 = max(xs) - min(xs)
diff2 = max(ys) - min(ys)
ans = max(diff1, diff2)
print(ans)
n = int(input())

xmi = 1e18
xma = -1e18
ymi = 1e18
yma = -1e18
for i in range(n):
    x, y = map(int, input().split())
    xmi = min(xmi, x+y)
    xma = max(xma, x+y)
    ymi = min(ymi, x-y)
    yma = max(yma, x-y)
ans = 0
ans = max(ans, xma - xmi)
ans = max(ans, yma - ymi)
print(ans)
import sys


def input():
    return sys.stdin.readline()[:-1]


N = int(input())

plus = []
minus = []
for _ 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
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N = I()
A,B = [],[]  # x+y,x-y たちのリスト
for i in range(N):
    x,y = MI()
    A.append(x+y)
    B.append(x-y)

print(max(max(A)-min(A),max(B)-min(B)))
N = int(input())
X = [0]*N
Y = [0]*N
for TN in range(0,N):
    A,B = (int(T) for T in input().split())
    X[TN] = A-B
    Y[TN] = A+B
print(max(max(X)-min(X),max(Y)-min(Y)))
n = int(input())
k = [0] * n
l = [0] * n
for i in range(n):
  x, y = [int(i) for i in input().split()]
  k[i] = x + y
  l[i] = x - y
print(max(max(k)-min(k), max(l)-min(l)))
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
def f(x):
    return x[0]-x[1]
def g(x):
    return x[0]+x[1]
ans = max(f(max(xy, key=f))-f(min(xy, key=f)),
          g(max(xy, key=g))-g(min(xy, key=g)),)
print(ans)
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

xzy = []
for _ in range(4):
  xzy.append([])

for x, y in xy:
  xzy[0].append(x + y)
  xzy[1].append(x - y)
  xzy[2].append(-x + y)
  xzy[3].append(-x - y)


anses = []
for z in xzy:
  anses.append(max(z) - min(z))
print(max(anses))
N=int(input())
x=[list(map(int,input().split())) for _ in range(N)]

A=[]
B=[]
C=[]
D=[]
for i in range(N):
    A.append(x[i][0]+x[i][1])
    B.append(-x[i][0]-x[i][1])
    C.append(x[i][0]-x[i][1])
    D.append(-x[i][0]-x[i][1])

print(max(max(A)-min(A),max(B)-min(B),max(C)-min(C),max(D)-min(D)))
#!/usr/bin/env python3
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    Z = []
    W = []
    for _ in range(n):
        x, y = map(int, input().split())
        z = x + y
        w = x - y
        Z.append(z)
        W.append(w)
    Z.sort()
    W.sort()
    print(max(abs(Z[0] - Z[-1]), abs(W[0] - W[-1])))



if __name__ == '__main__':
    main()