There are N points on the 2D plane, i-th of which is located on (x_i, y_i).
There can be multiple points that share the same coordinate.
What is the maximum possible Manhattan distance between two distinct points?
Here, the Manhattan distance between two points (x_i, y_i) and (x_j, y_j) is defined by |x_i-x_j| + |y_i-y_j|.

-----Constraints-----
 - 2 \leq N \leq 2 \times 10^5
 - 1 \leq x_i,y_i \leq 10^9
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N
x_1 y_1
x_2 y_2
:
x_N y_N

-----Output-----
Print the answer.

-----Sample Input-----
3
1 1
2 4
3 2

-----Sample Output-----
4

The Manhattan distance between the first point and the second point is |1-2|+|1-4|=4, which is maximum possible.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
a = []
b = []
for i in range(n):
  x,y = list(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)))




def main():
    n = int(input())
    z = [[], []]
    for i in range(n):
        x, y = list(map(int, input().split()))
        z[0].append(x + y)
        z[1].append(x - y)
    z[0] = sorted(z[0])
    z[1] = sorted(z[1])
    print((max(z[0][-1] - z[0][0], z[1][-1] - z[1][0])))



def __starting_point():
    main()

__starting_point()

def mdmax(x):
    a = []
    b = []
    for i in range(len(x)):
        a.append(x[i][0] - x[i][1])
        b.append(x[i][0] + x[i][1])
    return max(max(a) - min(a), max(b) - min(b))

n = int(input())
data = []
for i in range(n):
    ininput_data = input()
    input_data = list(map(int, ininput_data.split()))
    data.append(input_data)
print(mdmax(data))

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())

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

x.sort()
y.sort()

ans = max((x[-1]-x[0]), (y[-1]-y[0]))
print(ans)

n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
ans = []
l = [xy[i][0]+xy[i][1] for i in range(n)]
ans.append(max(l)-min(l))
l = [xy[i][0]-xy[i][1] for i in range(n)]
ans.append(max(l)-min(l))
l = [-xy[i][0]+xy[i][1] for i in range(n)]
ans.append(max(l)-min(l))
l = [-xy[i][0]-xy[i][1] for i in range(n)]
ans.append(max(l)-min(l))
print(max(ans))

n=int(input())
zp=[]
zl=[]
for i in range(n):
    a,b=map(int,input().split())
    zp.append(a+b)
    zl.append(a-b)
ans=max((max(zp)-min(zp)),(max(zl)-min(zl)))
print(ans)

def solve(n, x, y):
    z = [u + v for u, v in zip(x, y)]
    w = [u - v for u, v in zip(x, y)]
    return max([max(z) - min(z), max(w) - min(w)])

n = int(input())
x, y = zip(*[map(int, input().split()) for i in range(n)])
print(solve(n, x, y))

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

A=sorted(A)
B=sorted(B)

print(max(A[-1]-A[0],B[-1]-A[0],A[-1]-A[0],B[-1]-B[0]))

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

import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    dx = []
    dy = []
    for _ in range(N):
        x, y = map(int, input().split())
        dx.append(x + y)
        dy.append(x - y)
    dx.sort()
    dy.sort()
    print(max(dx[N-1] - dx[0], dy[N-1] - dy[0]))

    return

def __starting_point():
    solve()
__starting_point()

n=int(input())
a,b,c,d=-10**9,10**9,-10**9,10**9
for _ in range(n):
	x,y=map(int,input().split())
	a=max(a,x+y)
	b=min(b,x+y)
	c=max(c,x-y)
	d=min(d,x-y)
print(max(a-b,c-d))

n=int(input())
xy=[list(map(int, input().split())) for i in range(n)]
z=list(map(lambda x: x[0]+x[1], xy))
w=list(map(lambda x: x[0]-x[1], xy))
print(max(max(z)-min(z), max(w)-min(w)))

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]))

# coding: utf-8
# Your code here!
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())
xy_array = [list(map(int, input().split())) for _ in range(n)]

th = pow(10, 9)
right_up_max = -th
left_down_min = th
left_up_max = -th
right_down_min = th

for x, y in xy_array:
    right_up_max = max(x + y, right_up_max)
    left_down_min = min(x + y, left_down_min)
    left_up_max = max(x - y, left_up_max)
    right_down_min = min(x - y, right_down_min)

ans = max(right_up_max - left_down_min, left_up_max - right_down_min)
print(ans)

# import itertools
# import math
# from functools import reduce
# import sys
# sys.setrecursionlimit(500*500)
# import numpy as np
# from collections import deque
# import heapq

# 入力
N = int(input())
# S = input()
# n, *a = map(int, open(0))
# H, N = map(int, input().split())
# A = list(map(int, input().split()))
# A = list(map(lambda x: int(x)*(-1), input().split()))
# B = list(map(int, input().split()))
x_y = [list(map(int,input().split())) for _ in range(N)]
# S = input()

# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

# edges = [list(map(int,input().split())) for _ in range(N - 1)]
# tree = [[] for _ in range(N + 1)]

# for edge in edges:
#     tree[edge[0]].append(edge[1])
#     tree[edge[1]].append(edge[0])

# depth = [-1] * (N + 1)
# depth[1] = 0
# count = [0] * (N + 1)

# for i in range(Q):
#     p, x = map(int, input().split())
#     count[p] += x

# def dfs(tree, s):
#     for l in tree[s]:
#         if depth[l[0]] == -1:
#             depth[l[0]] = depth[s] + 1
#             dfs(tree, l[0])
# dfs(tree, 1)

# 素因数分解
# def factorization(n):
#     arr = []
#     temp = n
#     for i in range(2, int(-(-n**0.5//1))+1):
#         if temp%i==0:
#             cnt=0
#             while temp%i==0:
#                 cnt+=1
#                 temp //= i
#             arr.append([i, cnt])
#     if temp!=1:
#         arr.append([temp, 1])
#     if arr==[]:
#         arr.append([n, 1])
#     return arr

# 約数列挙
# def make_divisors(n):
#     lower_divisors , upper_divisors = [], []
#     i = 1
#     while i*i <= n:
#         if n % i == 0:
#             lower_divisors.append(i)
#             if i != n // i:
#                 upper_divisors.append(n//i)
#         i += 1
#     return lower_divisors + upper_divisors[::-1]

# bfs
# tree = [[] for _ in range(N + 1)]
# edges = [list(map(int,input().split())) for _ in range(M)]

# for edge in edges:
#     tree[edge[0]].append(edge[1])
#     tree[edge[1]].append(edge[0])

# depth = [-1] * (N + 1)
# depth[1] = 0

# d = deque()
# d.append(1)

# ans = [0] * (N + 1)
# while d:
#  v = d.popleft()
#  for i in tree[v]:
#    if depth[i] != -1:
#      continue
#    depth[i] = depth[v] + 1
#    ans[i] = v
#    d.append(i)

# # ans = depth[2:]
# print('Yes')
# print(*ans[2:], sep="\n")

# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

# # 高速素因数分解準備
# MAXN = 10**6+10
# sieve = [i for i in range(MAXN+1)]
# p = 2
# while p*p <= MAXN:
#     if sieve[p] == p:
#         for q in range(2*p, MAXN+1, p):
#             if sieve[q] == q:
#                 sieve[q] = p
#     p += 1


# 45度回転
Z = []
W = []
for l in x_y:
    Z.append(l[0] + l[1])
    W.append(l[0] - l[1])

print(max((max(Z) - min(Z)), (max(W) - min(W))))

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

n=int(input())
a,b=[],[]
for i in range(n):
  x,y=list(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())
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())
a = [0] * n
b = [0] * n
for i in range(n):
    x, y = list(map(int, input().split()))
    a[i] = x + y
    b[i] = x - y
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.sort()
b.sort()

ans=max(a[-1]-a[0],b[-1]-b[0])
print(ans)

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())
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)

n=int(input())
l=[]
ar=[]
br=[]
for i in range(n):
  l.append(list(map(int,input().split())))
  ar.append(l[-1][0]+l[-1][1])
  br.append(l[-1][0]-l[-1][1])
ar.sort()
br.sort()
an=max(abs(ar[-1]-ar[0]),abs(br[-1]-br[0]))
print(an)

N = int(input())
XY = [list(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())
maxa=maxb=-2e9
mina=minb=2e9
for i in range(n):
  x,y=list(map(int,input().split()))
  maxa=max(maxa,x+y)
  mina=min(mina,x+y)
  maxb=max(maxb,x-y)
  minb=min(minb,x-y)
print((max(maxa-mina,maxb-minb)))


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]))

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

add = sorted([x+y for x, y in xy])
sub = sorted([x-y for x, y in xy])

print(max(add[-1]-add[0], sub[-1]-sub[0]))

n=int(input())
lx=[]
ly=[]
for i in range(n):
  x,y=map(int,input().split())
  lx.append(x+y)
  ly.append(x-y)
print(max(max(lx)-min(lx),max(ly)-min(ly)))

N = int(input())
l0 = [[int(i) for i in input().split()] for _ in range(N)]
l1 = [0] * N
l2 = [0] * N
for cnt, val in enumerate(l0):
    l1[cnt] = val[0] + val[1]
    l2[cnt] = val[0] - val[1]
l1.sort()
l2.sort()
print((max(l1[-1] - l1[0], l2[-1] - l2[0])))


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))

def __starting_point():
    main()
__starting_point()

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

A=sorted(A)
B=sorted(B)

print(max(A[-1]-A[0],B[-1]-A[0],A[-1]-A[0],B[-1]-B[0]))

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

N = int(input())
A = []; B = []
for i in range(N):
  x,y = map(int,input().split())
  a = x+y; A.append(a)
  b = x-y; B.append(b)
A.sort();B.sort()
Max_A = A[-1] - A[0]
Max_B = B[-1] - B[0]
ans = max(Max_A,Max_B)
print(ans)

import sys

left_right_max = 0
left_right_min = float('inf')
right_left_max = float('-inf')
right_left_min = float('inf')
r3_max = float('-inf')
r3_min = float('inf')

n = int(sys.stdin.readline().strip())

for idx in range(n):
    x, y = sys.stdin.readline().strip().split(' ')
    x = int(x)
    y = int(y)

    left_right_tmp = x + y
    if left_right_tmp > left_right_max:
        left_right_max = left_right_tmp
      
    if left_right_tmp < left_right_min:
        left_right_min = left_right_tmp
        #res_lr[2] = (x, y)

    right_left_tmp = x - y
    if right_left_tmp > right_left_max:
        right_left_max = right_left_tmp
        #res_rl[1] = (x, y)
    if right_left_tmp < right_left_min:
        right_left_min = right_left_tmp
        #res_rl[2] = (x, y)
        
    r3_tmp = y - x
    if r3_tmp > r3_max:
        r3_max = r3_tmp
        #res_3[1] = (x, y)
    if r3_tmp < r3_min:
        r3_min = r3_tmp
        #res_3[2] = (x, y)

reslr_dist = left_right_max - left_right_min
resrl_dist = right_left_max - right_left_min
res3_dist = r3_max - r3_min

print((max(resrl_dist, reslr_dist, res3_dist)))


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

import sys
from operator import itemgetter

N = int(input())
V = set()
for s in sys.stdin.readlines():
    x, y = list(map(int, s.split()))
    V.add((x + y, x - y))

y_max = max(V, key=itemgetter(1))[1]
y_min = min(V, key=itemgetter(1))[1]
x_max = max(V, key=itemgetter(0))[0]
x_min = min(V, key=itemgetter(0))[0]

print((max(x_max - x_min, y_max - y_min)))


N = int(input())
a = list()
b = list()
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)

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)

"""AtCoder Beginner Contest 178.

E
"""

import sys


def input() -> str:  # noqa: A001
    """Input."""
    return sys.stdin.readline()[:-1]


def calc(p1: list, p2: list) -> int:
    """Calc Manhattan Distance."""
    return abs(p2[1] - p1[1]) + abs(p2[0] - p1[0])


def main():
    """Run."""
    n = int(input())

    patterns = {
        'lt': (1, 1),
        'rt': (-1, 1),
        'lb': (-1, -1),
        'rb': (1, -1),
    }

    points: dict = {k: None for k in list(patterns.keys())}

    for _ in range(n):
        p = list(map(int, input().split(' ')))

        for k, (x, y) in list(patterns.items()):
            max_p = points[k]

            if max_p:
                max_p_pos = (max_p[0] * x) + (max_p[1] * y)
                p_pos = (p[0] * x) + (p[1] * y)
                if max_p_pos < p_pos:
                    points[k] = p
            else:
                points[k] = p

    ans = 0
    for i, p1 in enumerate(points.values()):
        for p2 in list(points.values())[i + 1:]:
            ans = max(ans, calc(p1, p2))

    print(ans)


main()


import sys
readline = sys.stdin.readline

N = int(readline())
X,Y = [None] * N, [None] * N
for i in range(N):
  x,y = list(map(int,readline().split()))
  X[i],Y[i] = x + y,x - y

print((max(abs(max(X) - min(X)),abs(max(Y) - min(Y)))))


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)

#!/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(list(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)))


def __starting_point():
    main()

__starting_point()

N = int(input())
XY = [[int(_) for _ in input().split()] for _ in range(N)]
ans = -1
for dx, dy in ((1, 1), (-1, 1), (-1, -1), (1, -1)):
    xy2 = [x * dx + y * dy for x, y in XY]
    ans = max(ans, max(xy2) - min(xy2))
print(ans)


N = int(input())
A = [0]*N
B = [0]*N
for i in range(N):
  x,y = map(int,input().split())
  A[i] = x+y
  B[i] = x-y
a = max(A)-min(A)
b = max(B)-min(B)
print(max(a,b))

n = int(input())
l = [[] for i in range(4)]
for i in range(n):
    x, y = list(map(int, input().split()))
    l[0].append(x+y)
    l[1].append(x-y)
    l[2].append(-x+y)
    l[3].append(-x-y)
for i in range(4):
    l[i].sort()
ans = 0
for i in range(4):
    ans = max(ans, l[i][-1] - l[i][0])
print(ans)


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())
zls=[0 for _ in range(N)]
wls=[0 for _ in range(N)]
for i in range(N):
  x,y=[int(s) for s in input().split()]
  zls[i]=x+y
  wls[i]=x-y
print(max([max(zls)-min(zls),max(wls)-min(wls)]))

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
import re
import queue
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []



def main():
	N = i_input()

	x_y_list = []

	for i in range(0,N):
		tmpx,tmpy = i_map()
		x_y_list.append((tmpx,tmpy))

	z_list = []
	w_list = []
	for i in range(0,N):
		tmpz = x_y_list[i][0] + x_y_list[i][1]
		tmpw = x_y_list[i][0] - x_y_list[i][1]
		z_list.append(tmpz)
		w_list.append(tmpw)

	print(max(max(map(lambda x : (x),z_list))-min(map(lambda x: (x), z_list)),max(map(lambda x : (x),w_list))-min(map(lambda x: (x),w_list))))
	
	return


def __starting_point():
	main()
__starting_point()

n=int(input())
a,b,c,d=2*10**9,0,10**9,-10**9

for i in range(n):
  x,y=list(map(int,input().split()))
  a=a if a<x+y else x+y
  b=b if b>x+y else x+y
  c=c if c<y-x else y-x
  d=d if d>y-x else y-x

print((b-a if b-a>d-c else d-c))


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())
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())
u = []
v = []
for i in range(n):
    x, y = map(int, input().split())
    u.append(x + y)
    v.append(x - y)
    
u.sort()
v.sort()
print(max(u[-1] - u[0], v[-1] - v[0]))

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

th = pow(10, 9)
z_max = -th
z_min = th
w_max = -th
w_min = th

for x, y in xy_array:
    z_max = max(x + y, z_max)
    z_min = min(x + y, z_min)
    w_max = max(x - y, w_max)
    w_min = min(x - y, w_min)

ans = max(z_max - z_min, w_max - w_min)
print(ans)

n = int(input())

xy = []
for index in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

pos_max = xy[0][0]+xy[0][1]
pos_min = xy[0][0]+xy[0][1]
neg_max = xy[0][0]-xy[0][1]
neg_min = xy[0][0]-xy[0][1]
for item in xy:
  pos_v = item[0] + item[1]
  neg_v = item[0] - item[1]
  pos_max = pos_v if pos_v > pos_max else pos_max
  pos_min = pos_v if pos_v < pos_min else pos_min
  neg_max = neg_v if neg_v > neg_max else neg_max
  neg_min = neg_v if neg_v < neg_min else neg_min

pos_result = pos_max - pos_min
neg_result = neg_max - neg_min
print(pos_result if pos_result >= neg_result else neg_result)

n = int(input())
u = []
v = []
for _ in range(n):
    x, y = list(map(int, input().split()))
    u.append(x + y)
    v.append(x - y)

ans = max(max(u) - min(u), max(v) - min(v))
print(ans)


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 = list(zip(*[list(map(int, input().split())) for i in range(n)]))
print((solve(n, x, y)))


import sys
def Ii():return int(sys.stdin.readline())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))

n = Ii()
ans = 0
points = []
xymax = 0
xymin = 10**11
dxymax = -10**11
dxymin = 10**11
for i in range(n):
  point = Li()
  xy = point[0]+point[1]
  if xy > xymax:
    xymax = xy
  if xy < xymin:
    xymin = xy
  dxy = point[0]-point[1]
  if dxy > dxymax:
    dxymax = dxy
  if dxy < dxymin:
    dxymin = dxy
ans = max(dxymax-dxymin,xymax-xymin)
print(ans)

n = int(input())
# n = 2*10**5

min_u = float('inf')
max_u = -float('inf')
min_v = float('inf')
max_v = -float('inf')


for i in range(n):
    x, y = list(map(int, input().split()))
    # x, y = (10**9 , 10**9)
    u, v = (x+y, x-y)
    if u <= min_u:
        min_u = u
    if u >= max_u:
        max_u = u
    if v <= min_v:
        min_v = v
    if v >= max_v:
        max_v = v

print((max(max_u - min_u, max_v - min_v)))


import numpy as np

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

xy45 = [[xy[i][0] - xy[i][1], xy[i][0] + xy[i][1]] for i in range(N)]
xy45 = np.array(xy45)

print((max(max(xy45[:, 0]) - min(xy45[:, 0]), max(xy45[:, 1]) - min(xy45[:, 1]))))


import sys


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


N = int(input())

plus = []
minus = []
for _ in range(N):
    x, y = list(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())

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]))

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())
points = [tuple(map(int, input().split())) for _ in range(n)]
plus = [p[0] + p[1] for p in points]
minus = [p[0] - p[1] for p in points]
print(max(max(plus) - min(plus), max(minus) - min(minus)))

n = int(input())
a, b = [], []

for _ in range(n):
    x, y = list(map(int, input().split()))
    a.append(x - y)
    b.append(x + y)

ans = max(max(a) - min(a), max(b) - min(b))
print(ans)


N = int(input())
x = [0 for _ in range(N)]
y = [0 for _ in range(N)]

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

X = [0 for _ in range(N)]
Y = [0 for _ in range(N)]

for i in range(N):
    X[i], Y[i] = x[i] - y[i], x[i] + y[i]

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

print(ans)

def main():
    n = int(input())
    X, Y = [], []
    for _ in range(n):
        x, y = list(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])))

def __starting_point():
    main()


__starting_point()

import numpy as np
N = int(input())

x = []
y = []
xy1 = []
xy2 = []

for i in range(N):
    a, b = (int(t) for t in input().split())
    x.append(a)
    y.append(b)
    xy1.append(a + b)
    xy2.append(a - b)

max1 = max(xy1) - min(xy1)
max2 = max(xy2) - min(xy2)
print((max((max1, max2))))


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] = list(map(int, input().split()))
manhattan(n, x, y)


# -*- coding: utf-8 -*-

N = int(input())

XY = []
for n in range(N):
    (x, y) = (int(i) for i in input().split())
    XY.append([x, y])

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

print((max(max(plus)- min(plus), max(minus) - min(minus))))


_,*Z=open(0);A,B=[],[]
for z in Z:x,y=map(int,z.split());A+=[x+y];B+=[x-y]
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)-min(a)
B = max(b)-min(b)
print(max(A,B))

n=int(input())
zmi=wmi=int(1e+10)
zma=wma=int(-1e+10)
for i in range(n):
    xi,yi=list(map(int,input().split()))
    zma=max(xi+yi,zma)
    wma=max(xi-yi,wma)
    zmi=min(xi+yi,zmi)
    wmi=min(xi-yi,wmi)
print((max(zma-zmi,wma-wmi)))


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)))

def main():
    N = int(input())
    x, y = list(map(int, input().split()))
    a1 = x + y
    a2 = x + y
    b1 = y - x
    b2 = y - x
    N -= 1
    while N != 0:
        x, y = list(map(int, input().split()))
        a1 = max(a1, x + y)
        a2 = min(a2, x + y)
        b1 = max(b1, y - x)
        b2 = min(b2, y - x)
        N = N - 1
    print((max(a1 - a2, b1 - b2)))

main()


N =  int(input())
A =  [list(map(int, (input().split(' ')))) for i in range(N)]

hoge = [sum(a) for a in A]
fuga = [a[0] - a[1] for a in A]
print((max(max(hoge) - min(hoge), max(fuga) - min(fuga))))


n = int(input())

p_one = input()
p_one_list = p_one.split(' ')

zmax = int(p_one_list[0]) + int(p_one_list[1])
zmin = int(p_one_list[0]) + int(p_one_list[1])
wmax = int(p_one_list[0]) - int(p_one_list[1])
wmin = int(p_one_list[0]) - int(p_one_list[1])


for i in range(1, n):
    line = input()
    tmp = line.split(' ')
    z = int(tmp[0]) + int(tmp[1])
    w = int(tmp[0]) - int(tmp[1])
    zmax = max(zmax, z)
    wmax = max(wmax, w)
    zmin = min(zmin, z)
    wmin = min(wmin, w)


z_ans = zmax - zmin
w_ans = wmax - wmin


print(f'{max(z_ans, w_ans)}')


N=int(input())
L=[list(map(int,input().split())) for i in range(N)]
zmax=zmin=L[0][0]+L[0][1]
wmax=wmin=L[0][0]-L[0][1]
for a,b in L:
    z,w=a+b,a-b
    zmax=max(zmax,z)
    zmin=min(zmin,z)
    wmax=max(wmax,w)
    wmin=min(wmin,w)
print(max(zmax-zmin,wmax-wmin))

import re
import sys
import math
import itertools
import bisect
import heapq#.heapify:Priority Queueに変換 
#.heappop:最小値取得, .heappush:要素挿入
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return list(map(int,input().split()))
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
num = []
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

import numpy as np  
from scipy.spatial.distance import euclidean, cityblock  

n = k()
p = 0

a = []
b = []
for i in range(n):
    A,B = I()
    a.append(A)
    b.append(B)

z = []
w = []

for i in range(n):
    z.append(a[i]+b[i])
    w.append(a[i]-b[i])

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


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())
a,b,c,d=2*10**9,0,10**9,-10**9

for i in range(n):
  x,y=list(map(int,input().split()))
  a=min(a,x+y)
  b=max(b,x+y)
  c=min(c,y-x)
  d=max(d,y-x)

print((max(b-a,d-c)))


n = int(input())
z = []
w = []
for i in range(n):
    x,y = map(int,input().split())
    z.append(x+y)
    w.append(x-y)
zmax = max(z)-min(z)
wmax = max(w)-min(w)
print(max(zmax,wmax))

import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

INF = inf
MOD = 1000000007

n = int(input())
A = [[int(i) for i in input().split()]for j in range(n)]    # nは行数

tmp = 0
res = 0

ul = INF
ur = INF
bl = INF
br = INF
ul_index = 0
ur_index = 0
bl_index = 1
br_index = 1
for i in range(n):
    x, y = A[i]
    if x + 10e9 - y <= ul:
        ul = x + 10e9 - y
        ul_index = i
    if 10e9 - x + 10e9 - y <= ur:
        ur = 10e9 - x + 10e9 - y
        ur_index = i
    if x + y <= bl:
        bl = x + y
        bl_index = i
    if 10e9 - x + y <= br:
        br = 10e9 - x + y
        br_index = i
res = max(abs(A[ul_index][0] - A[br_index][0]) + abs(A[ul_index][1] - A[br_index][1]), abs(A[ur_index][0] - A[bl_index][0]) + abs(A[ur_index][1] - A[bl_index][1]))

print(res)


n= int(input())
a = [list(map(int, input().split())) for i in range(n)]
b = []
c = []
for i in range(n):
  b.append(a[i][0]+a[i][1])
  c.append(a[i][0]-a[i][1])
maxbc=[max(b)-min(b), max(c)-min(c)]
print(max(maxbc))

def main():
    n = int(input())
    pt = []
    for _ in range(n):
        x,y = map(int,input().split())
        pt.append([x,y])
    a,b,c = [],[],[]
    for p in pt:
        a.append(p[0]+p[1])
        b.append(p[0]-p[1])
        c.append(p[1]-p[0])
    ans = 0
    if max(a)-min(a)>ans:
        ans = max(a)-min(a)
    if max(b)-min(b)>ans:
        ans = max(b)-min(b)
    if max(c)-min(c)>ans:
        ans = max(c)-min(c)
    print(ans)

def __starting_point():
    main()
__starting_point()

#!/usr/bin/env python3


def main():
    n = int(input())

    ls = []
    for i in range(n):
        p = list(map(int, input().split()))
        np = (p[0] + p[1], p[0] - p[1])
        ls.append(np)

    minx = float("inf")
    miny = float("inf")
    maxx = -float("inf")
    maxy = -float("inf")

    for i in range(len(ls)):
        x, y = ls[i]
        minx = min(minx, x)
        miny = min(miny, y)
        maxx = max(maxx, x)
        maxy = max(maxy, y)

    print((max(maxx - minx, maxy - miny)))


main()



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

N = int(input())

xyp = []
xym = []

for _ in range(N):
    x, y = map(int, input().split())
    xyp.append(x+y)
    xym.append(x-y)
    
xyp.sort()
xym.sort()

print(max(xyp[-1] - xyp[0], xym[-1] - xym[0]))

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)))

import sys
input=sys.stdin.readline

n=int(input())
a,b,c,d=-10**9,10**9,-10**9,10**9
for _ in range(n):
	x,y=map(int,input().split())
	a=max(a,x+y)
	b=min(b,x+y)
	c=max(c,x-y)
	d=min(d,x-y)
print(max(a-b,c-d))

def solve():
    n = int(input())
    z = [0 for _ in range(n)]
    w = [0 for _ in range(n)]
    for i in range(n):
        a, b = list(map(int, input().split()))
        z[i] = a+b
        w[i] = a-b
    print((max(max(z)-min(z), max(w)-min(w))))


def __starting_point():
    solve()

__starting_point()

N = int(input())
a, b = [], []
for i in range(N):
    x, y = list(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 ans():
    N = int(input())
    Z = []  # x + y
    W = []  # x - y
    for _ in range(N):
        x, y = map(int, input().split())
        Z.append(x + y)
        W.append(x - y)

    z_max, z_min = max(Z), min(Z)
    w_max, w_min = max(W), min(W)

    max_d = max((z_max - z_min, w_max - w_min))
    print(max_d)


def __starting_point():
    ans()
__starting_point()

N = int(input())

xpy = []
xmy = []


for _ in range(N):
    x, y = map(int, input().split())

    xpy.append(x + y)
    xmy.append(x - y)

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

import sys

left_right_max = 0
left_right_min = float('inf')
right_left_max = float('-inf')
right_left_min = float('inf')
r3_max = float('-inf')
r3_min = float('inf')

n = int(sys.stdin.readline().strip())

for idx in range(n):
    x, y = sys.stdin.readline().strip().split(' ')
    x = int(x)
    y = int(y)

    left_right_tmp = x + y
    if left_right_tmp > left_right_max:
        left_right_max = left_right_tmp
    if left_right_tmp < left_right_min:
        left_right_min = left_right_tmp

    right_left_tmp = x - y
    if right_left_tmp > right_left_max:
        right_left_max = right_left_tmp
    if right_left_tmp < right_left_min:
        right_left_min = right_left_tmp
        
    r3_tmp = y - x
    if r3_tmp > r3_max:
        r3_max = r3_tmp
    if r3_tmp < r3_min:
        r3_min = r3_tmp

print(max(left_right_max - left_right_min, right_left_max - right_left_min, r3_max - r3_min))