Professor GukiZ makes a new robot. The robot are in the point with coordinates (x_1, y_1) and should go to the point (x_2, y_2). In a single step the robot can change any of its coordinates (maybe both of them) by one (decrease or increase). So the robot can move in one of the 8 directions. Find the minimal number of steps the robot should make to get the finish position.


-----Input-----

The first line contains two integers x_1, y_1 ( - 10^9 ≤ x_1, y_1 ≤ 10^9) — the start position of the robot.

The second line contains two integers x_2, y_2 ( - 10^9 ≤ x_2, y_2 ≤ 10^9) — the finish position of the robot.


-----Output-----

Print the only integer d — the minimal number of steps to get the finish position.


-----Examples-----
Input
0 0
4 5

Output
5

Input
3 4
6 1

Output
3



-----Note-----

In the first example robot should increase both of its coordinates by one four times, so it will be in position (4, 4). After that robot should simply increase its y coordinate and get the finish position.

In the second example robot should simultaneously increase x coordinate and decrease y coordinate by one three times.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Implementation


Solutions:
l = list(map(int, input().split()))
(x1, y1) = (l[0], l[1])
l = list(map(int, input().split()))
(x2, y2) = (l[0], l[1])
dx = abs(x2 - x1)
dy = abs(y2 - y1)
if dx > dy:
	print(dx)
else:
	print(dy)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
if x1 == x2:
	if y1 == y2:
		print('0')
	elif y1 < y2:
		print(abs(y2 - y1))
	elif y1 > y2:
		print(abs(y1 - y2))
elif x1 < x2:
	if y1 == y2:
		print(abs(x2 - x1))
	elif y1 < y2:
		if abs(x2 - x1) == abs(y2 - y1):
			print(abs(x2 - x1))
		elif abs(x2 - x1) > abs(y2 - y1):
			b = abs(y2 - y1)
			print(b + abs(x2 - (b + x1)))
		elif abs(x2 - x1) < abs(y2 - y1):
			b = abs(x2 - x1)
			print(b + abs(y2 - (b + y1)))
	elif y1 > y2:
		if abs(x2 - x1) == abs(y1 - y2):
			print(abs(x2 - x1))
		elif abs(x2 - x1) > abs(y1 - y2):
			b = abs(y1 - y2)
			print(b + abs(x2 - (b + x1)))
		elif abs(x2 - x1) < abs(y2 - y1):
			b = abs(x2 - x1)
			print(b + abs(y1 - b - y2))
elif x1 > x2:
	if y1 == y2:
		print(abs(x1 - x2))
	elif y1 < y2:
		if abs(x1 - x2) == abs(y2 - y1):
			print(abs(x1 - x2))
		elif abs(x1 - x2) > abs(y2 - y1):
			b = abs(y2 - y1)
			print(b + abs(x1 - b - x2))
		elif abs(x1 - x2) < abs(y2 - y1):
			b = abs(x1 - x2)
			print(b + abs(y2 - (b + y1)))
	elif y1 > y2:
		if abs(x1 - x2) == abs(y1 - y2):
			print(abs(x1 - x2))
		elif abs(x1 - x2) > abs(y1 - y2):
			b = abs(y1 - y2)
			print(b + abs(x1 - b - x2))
		elif abs(x1 - x2) < abs(y2 - y1):
			b = abs(x1 - x2)
			print(b + abs(y1 - b - y2))


(x1, y1) = [int(x) for x in input().split()]
(x2, y2) = [int(x) for x in input().split()]
print(max(abs(x2 - x1), abs(y2 - y1)))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
print(max(abs(x2 - x1), abs(y2 - y1)))


(a, b) = map(int, input().split(' '))
(c, d) = map(int, input().split(' '))
print(max(abs(a - c), abs(b - d)))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
a = abs(x2 - x1)
b = abs(y2 - y1)
ans = min(a, b)
a -= ans
b -= ans
ans += a + b
print(ans)


(a, b) = map(int, input().split())
(c, d) = map(int, input().split())
x = abs(a - c)
y = abs(b - d)
valor = max(x, y)
print(valor)


(iX, iY) = map(int, input().split(' '))
(fX, fY) = map(int, input().split(' '))
print(max(abs(iX - fX), abs(iY - fY)))


(x, y) = map(int, input().split())
(a, b) = map(int, input().split())
h = abs(x - a)
l = abs(y - b)
if h == l:
	print(h)
else:
	print(max(h, l))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
a = abs(x1 - x2)
b = abs(y1 - y2)
print(max(a, b))


(n, m) = map(int, input().split())
(p, q) = map(int, input().split())
print(max(abs(n - p), abs(m - q)))


(x1, y1) = list(map(int, input().strip().split()))
(x2, y2) = list(map(int, input().strip().split()))
print(max(abs(x2 - x1), abs(y2 - y1)))


(x, y) = map(int, input().split())
(X, Y) = map(int, input().split())
print(max(abs(X - x), abs(Y - y)))


(x1, y1) = list(map(int, input().split()))
(x2, y2) = list(map(int, input().split()))
steps = 0
if x1 == x2 and y1 != y2:
	steps = abs(y1 - y2)
elif x1 != x2 and y1 == y2:
	steps = abs(x1 - x2)
elif x1 != x2 and y1 != y2:
	a = min(abs(x1 - x2), abs(y1 - y2))
	b = max(abs(x1 - x2), abs(y1 - y2)) - a
	steps = a + b
print(steps)


(a, b) = map(int, input().split())
(c, d) = map(int, input().split())
if a > c:
	a = a - c
else:
	a = c - a
if b > d:
	b = b - d
else:
	b = d - b
print(min(a, b) + (max(a, b) - min(a, b)))


(x1, y1) = tuple(map(int, input().split()))
(x2, y2) = tuple(map(int, input().split()))
(dx, dy) = (abs(x2 - x1), abs(y2 - y1))
print(min(dx, dy) + max(dx, dy) - min(dx, dy))


(a, b) = map(int, input().split())
(c, d) = map(int, input().split())

def f(a, b, c, d):
	x = abs(a - c)
	y = abs(b - d)
	e = min(x, y)
	if e == x:
		print(e + min(abs(b + e - d), abs(b - e - d)))
	else:
		print(e + min(abs(a - e - c), abs(a + e - c)))
f(a, b, c, d)


(a, b) = list(map(int, input().split()))
(x, y) = list(map(int, input().split()))
print(max(abs(x - a), abs(y - b)))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
m1 = min(abs(x1 - x2), abs(y1 - y2))
m2 = max(abs(x1 - x2), abs(y1 - y2))
print(m2)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
d1 = abs(x2 - x1)
d2 = abs(y2 - y1)
s = min(d1, d2)
s = s + max(d1, d2) - min(d1, d2)
print(s)


(x, y) = [int(x) for x in input().split()]
(xf, yf) = [int(x) for x in input().split()]
if xf > x:
	suma1 = xf - x
else:
	suma1 = x - xf
if yf > y:
	suma2 = yf - y
else:
	suma2 = y - yf
if suma1 > suma2:
	pasos = suma1
else:
	pasos = suma2
print(pasos)


(x, y) = [int(n) for n in input().split()]
(x1, y1) = [int(n) for n in input().split()]
ans = max(abs(x1 - x), abs(y1 - y))
print(ans)


import sys
(x, y) = map(int, input().split())
(x1, y1) = map(int, input().split())
print(max(abs(x - x1), abs(y - y1)))


(x1, y1) = list(map(int, input().split()))
(x2, y2) = list(map(int, input().split()))
(Max, Min) = (max([abs(x2 - x1), abs(y2 - y1)]), min([abs(x2 - x1), abs(y2 - y1)]))
print(Min + (Max - Min))


import math
x1y1 = list(map(int, input().split()))
x2y2 = list(map(int, input().split()))
x1 = 0
y1 = 0
x2 = math.fabs(x2y2[0] - x1y1[0])
y2 = math.fabs(x2y2[1] - x1y1[1])
if x2 > y2:
	print(int(x2))
else:
	print(int(y2))


(a, b) = input().split()
x1 = int(a)
y1 = int(b)
(a, b) = input().split()
x2 = int(a)
y2 = int(b)
gap_x = abs(x2 - x1)
gap_y = abs(y2 - y1)
if gap_x < gap_y:
	ans = gap_x + gap_y - gap_x
else:
	ans = gap_y + gap_x - gap_y
print(ans)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
if abs(x1 - x2) > abs(y1 - y2):
	print(abs(x1 - x2))
else:
	print(abs(y1 - y2))


try:
	while True:
		(x1, y1) = list(map(int, input().split()))
		(x2, y2) = list(map(int, input().split()))
		print(max(abs(x1 - x2), abs(y1 - y2)))
except EOFError:
	pass


(x1, x2) = map(int, input().split())
(x3, x4) = map(int, input().split())
a = abs(x2 - x4)
b = abs(x1 - x3)
print(max(a, b))


[x_1, y_1] = [int(i) for i in input().split()]
[x_2, y_2] = [int(i) for i in input().split()]
print(max(abs(x_1 - x_2), abs(y_1 - y_2)))


raw_data = input().split()
x_coor = int(raw_data[0])
y_coor = int(raw_data[1])
destination = input().split()
dest_x = int(destination[0])
dest_y = int(destination[1])
x_steps = abs(x_coor - dest_x)
y_steps = abs(y_coor - dest_y)
if x_steps > y_steps:
	print(x_steps)
else:
	print(y_steps)


(px, py) = [int(i) for i in input().split()]
(x, y) = [int(i) for i in input().split()]
print(min(abs(x - px), abs(y - py)) + max(abs(x - px), abs(y - py)) - min(abs(x - px), abs(y - py)))


(x, y) = map(int, input().split())
(a, b) = map(int, input().split())
ans = max(abs(x - a), abs(y - b))
print(ans)


(a, b) = [int(i) for i in input().split()]
(c, d) = [int(i) for i in input().split()]
print(max(abs(a - c), abs(b - d)))


(x1, y1) = input().split()
(x2, y2) = input().split()
(x1, y1, x2, y2) = (int(x1), int(y1), int(x2), int(y2))
dx = abs(x1 - x2)
dy = abs(y1 - y2)
print(max(dx, dy))


anitonezkousejkontrolovat = input()
vidimte = input()
zacatek = [int(n) for n in anitonezkousejkontrolovat.split()]
konec = [int(n) for n in vidimte.split()]
rozdil1 = abs(zacatek[0] - konec[0])
rozdil2 = abs(zacatek[1] - konec[1])
print(max(rozdil1, rozdil2))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
(z1, z2) = (abs(x1 - x2), abs(y1 - y2))
print(max(z1, z2))


(a, b) = [int(x) for x in input().split()]
(c, d) = [int(x) for x in input().split()]
xdiff = abs(a - c)
ydiff = abs(b - d)
if xdiff < ydiff:
	ans = xdiff
	ans = ans + (ydiff - xdiff)
else:
	ans = ydiff
	ans = ans + (xdiff - ydiff)
print(ans)


[x1, y1] = map(int, input().split())
[x2, y2] = map(int, input().split())
distanceX = abs(x1 - x2)
distanceY = abs(y1 - y2)
print(min(distanceX, distanceY) + max(distanceX, distanceY) - min(distanceX, distanceY))


fir = input().split()
sec = input().split()
fir[0] = int(fir[0])
fir[1] = int(fir[1])
sec[0] = int(sec[0])
sec[1] = int(sec[1])
xchange = abs(fir[0] - sec[0])
ychange = abs(fir[1] - sec[1])
print(max(xchange, ychange))


L = input().split(' ')
x1 = int(L[0])
y1 = int(L[1])
L = input().split(' ')
x2 = int(L[0])
y2 = int(L[1])
m1 = abs(x2 - x1)
m2 = abs(y2 - y1)
mi = min(m1, m2)
ma = max(m1, m2)
print(ma)


from sys import stdin, stdout
(x1, y1) = [int(x) for x in stdin.readline().rstrip().split()]
(x2, y2) = [int(x) for x in stdin.readline().rstrip().split()]
mx = 0
if x1 > x2:
	mx = x1 - x2
elif x1 < x2:
	mx = x2 - x1
my = 0
if y1 > y2:
	my = y1 - y2
elif y1 < y2:
	my = y2 - y1
ans = max(mx, my)
stdout.write(str(ans) + '\n')


from math import *
(s1, s2) = input().split()
x1 = int(s1)
y1 = int(s2)
(s1, s2) = input().split()
x2 = int(s1)
y2 = int(s2)
print(max(abs(x1 - x2), abs(y1 - y2)))


import math
start = list(map(int, input().split()))
end = list(map(int, input().split()))
print(max(abs(start[0] - end[0]), abs(start[1] - end[1])))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
print(max(max(x1, x2) - min(x1, x2), max(y1, y2) - min(y1, y2)))


n = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
z1 = abs(x[0] - n[0])
z2 = abs(x[1] - n[1])
print(min(z1, z2) + abs(z1 - z2))


a = list(map(int, input().split()))
b = list(map(int, input().split()))
print(max([abs(a[0] - b[0]), abs(a[1] - b[1])]))


(rx, ry) = map(int, input().split())
(x, y) = map(int, input().split())
print(max(abs(x - rx), abs(y - ry)))


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(x1, y1) = get_ints()
(x2, y2) = get_ints()
mini = min(abs(x2 - x1), abs(y2 - y1))
ans = abs(abs(x2 - x1) - abs(y2 - y1))
print(mini + ans)


import math
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
print(max(abs(x1 - x2), abs(y1 - y2)))


start = [int(entry) for entry in input().split()]
end = [int(entry) for entry in input().split()]
x_dist = abs(start[0] - end[0])
y_dist = abs(start[1] - end[1])
result = x_dist + y_dist - min(x_dist, y_dist) * (1 if x_dist > 0 and y_dist > 0 else 0)
print(result)


[xr, yr] = map(int, input().split())
[x, y] = map(int, input().split())
xdistance = abs(x - xr)
ydistance = abs(y - yr)
if xdistance > ydistance:
	a = xdistance - ydistance
	print(abs(ydistance + a))
if xdistance < ydistance:
	a = ydistance - xdistance
	print(abs(xdistance + a))
if xdistance == ydistance:
	print(xdistance)


(x1, y1) = list(map(int, input().split()))
(x2, y2) = list(map(int, input().split()))
(x_change, y_change, ans) = (0, 0, 0)
if x2 > x1:
	x_change = 1
elif x2 < x1:
	x_change = -1
else:
	x_change = 0
if y2 > y1:
	y_change = 1
elif y2 < y1:
	y_change = -1
else:
	y_change = 0
if abs(x2 - x1) <= abs(y2 - y1):
	new_y = y1 + y_change * abs(x2 - x1)
	ans = abs(x2 - x1) + abs(new_y - y2)
else:
	new_x = x1 + x_change * abs(y2 - y1)
	ans = abs(y2 - y1) + abs(new_x - x2)
print(ans)


(a, b) = [int(i) for i in input().split()]
(c, d) = [int(i) for i in input().split()]
x = max(a, c) - min(a, c)
y = max(b, d) - min(b, d)
print(max(x, y))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
t = 0
print(max(abs(x2 - x1), abs(y2 - y1)))


class CodeforcesTask620ASolution:

	def __init__(self):
		self.result = ''
		self.r_cord = []
		self.d_cord = []

	def read_input(self):
		self.r_cord = [int(x) for x in input().split(' ')]
		self.d_cord = [int(x) for x in input().split(' ')]

	def process_task(self):
		self.result = str(max(abs(self.r_cord[0] - self.d_cord[0]), abs(self.r_cord[1] - self.d_cord[1])))

	def get_result(self):
		return self.result
Solution = CodeforcesTask620ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
aux = max(x1 - x2, x2 - x1)
aux2 = max(y1 - y2, y2 - y1)
print(max(aux, aux2))


(x1, y1) = (int(i) for i in input().split())
(x2, y2) = (int(j) for j in input().split())
print(max(abs(x1 - x2), abs(y1 - y2)))


s = input()
s = s.split()
x1 = int(s[0])
y1 = int(s[1])
s = input()
s = s.split()
x2 = int(s[0])
y2 = int(s[1])
t1 = abs(x2 - x1)
t2 = abs(y2 - y1)
print(max(t1, t2))


(x1, y1) = (int(x) for x in input().split())
(x2, y2) = (int(x) for x in input().split())
dx = abs(x1 - x2)
dy = abs(y1 - y2)
print(min(dy, dx) + max(dx, dy) - min(dx, dy))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
x = abs(x1 - x2)
y = abs(y1 - y2)
b = max(x, y)
print(b)


string = input()
numbers = string.split()
(x1, y1) = (int(numbers[0]), int(numbers[1]))
string = input()
numbers = string.split()
(x2, y2) = (int(numbers[0]), int(numbers[1]))
a = abs(x1 - x2)
b = abs(y1 - y2)
print(max([a, b]))


import math
[x, y] = map(int, input().split())
[x2, y2] = map(int, input().split())
c = 0
if y2 < y:
	y2 = 2 * y - y2
if x2 < x:
	x2 = 2 * x - x2
y2 = y2 - y
x2 = x2 - x
if x2 < y2:
	c = y2
if x2 > y2:
	c = x2
if x2 == y2:
	c = x2
print(c)


r = lambda : map(int, input().split())
(a, b) = r()
(x, y) = r()
print(max(abs(a - x), abs(b - y)))


X = list(map(int, input().split()))
Y = list(map(int, input().split()))
print(max(abs(X[0] - Y[0]), abs(X[1] - Y[1])))


(x1, y1) = (int(x) for x in input().split())
(x2, y2) = (int(x) for x in input().split())
if abs(x2 - x1) > abs(y2 - y1):
	print(abs(x2 - x1))
else:
	print(abs(y2 - y1))


a = input()
a = list(map(int, a.split()))
x1 = a[0]
y1 = a[1]
a = input()
a = list(map(int, a.split()))
x2 = a[0]
y2 = a[1]
difx = abs(x2 - x1)
dify = abs(y2 - y1)
ret = max(difx, dify)
print(ret)


(x1, y1) = input().split()
(x2, y2) = input().split()
a = abs(int(x1) - int(x2))
b = abs(int(y1) - int(y2))
if a < b:
	print(b)
elif a == b:
	print(a)
else:
	print(a)


c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
print(max(abs(c1[0] - c2[0]), abs(c1[1] - c2[1])))


(x, y) = map(int, input().split())
(a, b) = map(int, input().split())
resp = max(abs(x - a), abs(y - b))
print(resp)


(x, y) = list(map(int, input().split()))
(x1, y1) = list(map(int, input().split()))
print(max(abs(x - x1), abs(y - y1)))


import sys
(x1, y1) = map(int, sys.stdin.readline().split())
(x2, y2) = map(int, sys.stdin.readline().split())
print(max(abs(x2 - x1), abs(y2 - y1)))


(w, h) = map(int, input().split())
(u, a) = map(int, input().split())
print(max(abs(w - u), abs(h - a)))


print(max((abs(a - b) for (a, b) in zip(*[map(int, input().split()) for _ in (1, 2)]))))


(a, b) = map(int, input().split())
(c, d) = map(int, input().split())
t1 = abs(a - c)
t2 = abs(b - d)
print(max(t1, t2))


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
ABCD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(a, b) = map(int, input().split(' '))
(c, d) = map(int, input().split(' '))
print(max(abs(a - c), abs(b - d)))


from math import fabs

def max(a, b):
	return a if a > b else b
(x1, y1) = map(int, input().split(' '))
(x2, y2) = map(int, input().split(' '))
mx = max(fabs(x2 - x1), fabs(y2 - y1))
print(int(mx))


read = lambda : list(map(int, input().split()))
(x1, y1) = read()
(x2, y2) = read()
print(max(abs(y1 - y2), abs(x1 - x2)))


(a, b) = map(int, input().split())
(n, m) = map(int, input().split())
(n, m) = (abs(n - a), abs(m - b))
(n, m) = (min(n, m), max(n, m))
print(m)


from math import *
(x1, y1) = [int(i) for i in input().split()]
(x2, y2) = [int(i) for i in input().split()]
print(max(abs(x1 - x2), abs(y1 - y2)))


[a, b] = map(int, input().split())
[c, d] = map(int, input().split())
x = abs(int(a - c))
y = abs(int(b - d))
if x >= y:
	print(int(x))
elif y > x:
	print(int(y))


x = input().split(' ')
y = input().split(' ')
print(max(abs(int(x[0]) - int(y[0])), abs(int(x[1]) - int(y[1]))))


3
(x1, y1) = input().split()
(x1, y1) = (int(x1), int(y1))
(x2, y2) = input().split()
(x2, y2) = (int(x2), int(y2))
print(max(abs(x1 - x2), abs(y1 - y2)))


(a, b) = list(map(int, input().split()))
(x, y) = list(map(int, input().split()))
if abs(x - a) < abs(y - b):
	dist = abs(x - a)
	dist += abs(y - b) - dist
else:
	dist = abs(y - b)
	dist += abs(x - a) - dist
print(dist)


starting = input()
starting = starting.split()
x1 = int(starting[0])
y1 = int(starting[1])
ending = input()
ending = ending.split()
x2 = int(ending[0])
y2 = int(ending[1])
x_diff = abs(x2 - x1)
y_diff = abs(y2 - y1)
if x_diff < y_diff:
	ans = y_diff
elif y_diff < x_diff:
	ans = x_diff
else:
	ans = x_diff
print(ans)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
x = abs(x2 - x1)
y = abs(y2 - y1)
print(min(x, y) + (x - min(x, y)) + (y - min(x, y)))


def main():
	(x1, y1) = map(int, input().split())
	(x2, y2) = map(int, input().split())
	v1 = abs(x2 - x1)
	v2 = abs(y2 - y1)
	num_steps = 0
	num_steps += min(v1, v2)
	num_steps += max(v1, v2) - min(v1, v2)
	print(num_steps)
main()


def robot(lst1, lst2):
	a = abs(lst1[0] - lst2[0])
	b = abs(lst1[1] - lst2[1])
	return max(a, b)
z1 = [int(i) for i in input().split()]
z2 = [int(j) for j in input().split()]
print(robot(z1, z2))


import sys
p1 = sys.stdin.readline().split(' ')
p2 = sys.stdin.readline().split(' ')
x1 = int(p1[0])
y1 = int(p1[1])
x2 = int(p2[0])
y2 = int(p2[1])
print(abs(x2 - x1) + abs(y2 - y1) - min(abs(x2 - x1), abs(y2 - y1)))


(rx, ry) = map(int, input().split())
(x, y) = map(int, input().split())
print(min(abs(x - rx), abs(y - ry)) + abs(abs(x - rx) - abs(y - ry)))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
print(min(abs(x2 - x1), abs(y2 - y1)) + abs(abs(x2 - x1) - abs(y2 - y1)))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	(a, b) = LI()
	(c, d) = LI()
	return max(abs(a - c), abs(b - d))
print(main())


(a, b) = map(int, input().split())
(c, d) = map(int, input().split())
(e, f) = (abs(a - c), abs(b - d))
print(int(max(e, f)))


(x1, y1) = list(map(int, input().split()))
(x2, y2) = list(map(int, input().split()))
a = abs(abs(x1 - x2) - abs(y1 - y2))
b = abs(abs(x1 - x2) + abs(y1 - y2))
print(a + abs(b - a) // 2)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
t = min(abs(x2 - x1), abs(y2 - y1))
if x1 < x2:
	x1 += t
if x1 > x2:
	x1 -= t
if y1 < y2:
	y1 += t
if y1 > y2:
	y1 -= t
print(t + abs(x2 - x1) + abs(y2 - y1))


(x2, y2) = map(int, input().split())
(x1, y1) = map(int, input().split())
m = min(abs(x1 - x2), abs(y2 - y1))
d = max(abs(x1 - x2), abs(y2 - y1))
ans = m + d - m
print(ans)


p1 = list(map(int, input().split()))
p2 = list(map(int, input().split()))
dx = p1[0] - p2[0] if p1[0] > p2[0] else p2[0] - p1[0]
dy = p1[1] - p2[1] if p1[1] > p2[1] else p2[1] - p1[1]
print(max(dx, dy))


a1 = input()
a2 = input()
a1 = a1.split(' ')
a2 = a2.split(' ')
x1 = int(a1[0])
y1 = int(a1[1])
x2 = int(a2[0])
y2 = int(a2[1])
dx = abs(x2 - x1)
dy = abs(y2 - y1)
print(max(dx, dy))


(x, y) = map(int, input().split())
(xx, yy) = map(int, input().split())
dx = abs(xx - x)
dy = abs(yy - y)
print(min(dx, dy) + abs(dx - dy))


(x1, y1) = (int(i) for i in input().split())
(x2, y2) = (int(i) for i in input().split())
ans = 0
wx = abs(x1 - x2)
wy = abs(y1 - y2)
firstway = min(abs(x1 - x2), abs(y1 - y2))
ans += firstway
wx -= firstway
wy -= firstway
ans += wx + wy
print(ans)


(x, y) = map(int, input().split())
(x1, y1) = map(int, input().split())
if x1 - x > 0:
	t = x1 - x
else:
	t = x - x1
if y1 - y > 0:
	t1 = y1 - y
else:
	t1 = y - y1
print(max(t, t1))


from math import *
(sx, sy) = map(int, input().split())
(tx, ty) = map(int, input().split())
print(max(abs(sx - tx), abs(sy - ty)))


[x1, y1] = map(int, input().split())
[x2, y2] = map(int, input().split())
xdiff = abs(x2 - x1)
ydiff = abs(y2 - y1)
print(max(xdiff, ydiff))


(x_start, y_start) = map(int, input().split())
(x_end, y_end) = map(int, input().split())
if x_end > x_start:
	x_steps = x_end - x_start
else:
	x_steps = x_start - x_end
if y_end > y_start:
	y_steps = y_end - y_start
else:
	y_steps = y_start - y_end
if y_steps >= x_steps:
	print(y_steps)
else:
	print(x_steps)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
xdiff = abs(x2 - x1)
ydiff = abs(y2 - y1)
if xdiff > ydiff:
	print(xdiff)
elif ydiff > xdiff:
	print(ydiff)
else:
	print(xdiff)


p1 = list(map(int, input().split()))
x1 = p1[0]
y1 = p1[1]
p2 = list(map(int, input().split()))
x2 = p2[0]
y2 = p2[1]
yo1 = abs(x1 - x2)
yo2 = abs(y1 - y2)
chota = min(yo1, yo2)
bada = max(yo1, yo2)
ans = chota + (bada - chota)
print(ans)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
m = abs(x2 - x1)
n = abs(y2 - y1)
if m == n:
	print(m)
else:
	print(max(m, n))


args1 = input().split()
args2 = input().split()
x1 = int(args1[0])
x2 = int(args2[0])
y1 = int(args1[1])
y2 = int(args2[1])
print(max(abs(x1 - x2), abs(y1 - y2)))


def solution(l1, l2):
	return max(abs(l1[0] - l2[0]), abs(l1[1] - l2[1]))

def answer():
	l1 = [int(x) for x in input().split()]
	l2 = [int(x) for x in input().split()]
	print(solution(l1, l2))
answer()


(n, m) = (int(x) for x in input().split())
(i, j) = (int(x) for x in input().split())
print(max(abs(n - i), abs(m - j)))


[x, y] = map(int, input().split())
[X, Y] = map(int, input().split())
Steps = abs(y - Y)
Steps2 = abs(x - X)
if Steps > Steps2:
	print(Steps)
else:
	print(Steps2)


(x, y) = map(int, input().split())
(n, m) = map(int, input().split())
print([abs(x - n), abs(y - m)][abs(x - n) < abs(y - m)])


(x0, y0) = map(int, input().split())
(x1, y1) = map(int, input().split())
X = abs(x1 - x0)
Y = abs(y1 - y0)
print(X + Y - min(X, Y))


import math
(x1, y1) = (int(i) for i in input().split())
(x2, y2) = (int(i) for i in input().split())
s = 0
max = 0
if math.fabs(x2 - x1) > math.fabs(y2 - y1):
	max = int(math.fabs(y2 - y1))
else:
	max = int(math.fabs(x2 - x1))
s += max
if x1 > x2:
	x1 -= max
else:
	x1 += max
if y1 > y2:
	y1 -= max
else:
	y1 += max
if x1 != x2:
	max = math.fabs(x1 - x2)
	max = int(max)
	s += max
if y1 != y2:
	max = math.fabs(y1 - y2)
	max = int(max)
	s += max
print(s)


(x0, y0) = input().split()
x0 = int(x0)
y0 = int(y0)
(x, y) = input().split()
x = int(x)
y = int(y)
dx = abs(x - x0)
dy = abs(y - y0)
mn = min(dx, dy)
dx -= mn
dy -= mn
res = dx + dy
print(mn + res)


R = lambda : map(int, input().split())
(x1, y1) = R()
(x2, y2) = R()
d1 = abs(x1 - x2)
d2 = abs(y1 - y2)
print(d1 + d2 - min(d1, d2))


xy1 = list(map(int, input().split()))
xy2 = list(map(int, input().split()))
print(max(abs(xy2[0] - xy1[0]), abs(xy2[1] - xy1[1])))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
mi = min(abs(x1 - x2), abs(y1 - y2))
ma = max(abs(x1 - x2), abs(y1 - y2))
print(mi + ma - mi)


from functools import cmp_to_key
from collections import deque, Counter
from heapq import heappush, heappop
from math import log, ceil
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def ii():
	return int(inp())

def si():
	return str(inp())

def li(lag=0):
	l = list(map(int, inp().split()))
	if lag != 0:
		for i in range(len(l)):
			l[i] += lag
	return l

def mi(lag=0):
	matrix = list()
	for i in range(n):
		matrix.append(li(lag))
	return matrix

def lsi():
	return list(map(str, inp().split()))

def print_list(lista, space=' '):
	print(space.join(map(str, lista)))

def bisect_left(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] < x:
			left = mid + 1
		else:
			right = mid
	return left

def bisect_right(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] > x:
			right = mid
		else:
			left = mid + 1
	return left

def bisect_elements(a, x):
	return bisect_right(a, x) - bisect_left(a, x)
MOD = 10 ** 9 + 7
maxN = 5
FACT = [0] * maxN
INV_FACT = [0] * maxN

def add(x, y):
	return (x + y) % MOD

def multiply(x, y):
	return x * y % MOD

def power(x, y):
	if y == 0:
		return 1
	elif y % 2:
		return multiply(x, power(x, y - 1))
	else:
		a = power(x, y // 2)
		return multiply(a, a)

def inverse(x):
	return power(x, MOD - 2)

def divide(x, y):
	return multiply(x, inverse(y))

def allFactorials():
	FACT[0] = 1
	for i in range(1, maxN):
		FACT[i] = multiply(i, FACT[i - 1])

def inverseFactorials():
	n = len(INV_FACT)
	INV_FACT[n - 1] = inverse(FACT[n - 1])
	for i in range(n - 2, -1, -1):
		INV_FACT[i] = multiply(INV_FACT[i + 1], i + 1)

def coeffBinom(n, k):
	if n < k:
		return 0
	return multiply(FACT[n], multiply(INV_FACT[k], INV_FACT[n - k]))

def create_graph(n, m, undirected=1, unweighted=1):
	graph = [[] for i in range(n)]
	if unweighted:
		for i in range(m):
			[x, y] = li(lag=-1)
			graph[x].append(y)
			if undirected:
				graph[y].append(x)
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			graph[x].append([y, w])
			if undirected:
				graph[y].append([x, w])
	return graph

def create_tree(n, unweighted=1):
	children = [[] for i in range(n)]
	if unweighted:
		for i in range(n - 1):
			[x, y] = li(lag=-1)
			children[x].append(y)
			children[y].append(x)
	else:
		for i in range(n - 1):
			[x, y, w] = li(lag=-1)
			w += 1
			children[x].append([y, w])
			children[y].append([x, w])
	return children

def dist(tree, n, A, B=-1):
	s = [[A, 0]]
	(massimo, massimo_nodo) = (0, 0)
	distanza = -1
	v = [-1] * n
	while s:
		(el, dis) = s.pop()
		if dis > massimo:
			massimo = dis
			massimo_nodo = el
		if el == B:
			distanza = dis
		for child in tree[el]:
			if v[child] == -1:
				v[child] = 1
				s.append([child, dis + 1])
	return (massimo, massimo_nodo, distanza)

def diameter(tree):
	(_, foglia, _) = dist(tree, n, 0)
	(diam, _, _) = dist(tree, n, foglia)
	return diam

def dfs(graph, n, A):
	v = [-1] * n
	s = [[A, 0]]
	v[A] = 0
	while s:
		(el, dis) = s.pop()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def bfs(graph, n, A):
	v = [-1] * n
	s = deque()
	s.append([A, 0])
	v[A] = 0
	while s:
		(el, dis) = s.popleft()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def parents_children_root_unrooted_tree(tree, n, root=0):
	q = deque()
	visited = [0] * n
	parent = [-1] * n
	children = [[] for i in range(n)]
	q.append(root)
	while q:
		all_done = 1
		visited[q[0]] = 1
		for child in tree[q[0]]:
			if not visited[child]:
				all_done = 0
				q.appendleft(child)
		if all_done:
			for child in tree[q[0]]:
				if parent[child] == -1:
					parent[q[0]] = child
					children[child].append(q[0])
			q.popleft()
	return (parent, children)

def all_longest_path_passing_from_node(parent, children, n):
	q = deque()
	visited = [len(children[i]) for i in range(n)]
	downwards = [[0, 0] for i in range(n)]
	upward = [1] * n
	longest_path = [1] * n
	for i in range(n):
		if not visited[i]:
			q.append(i)
			downwards[i] = [1, 0]
	while q:
		node = q.popleft()
		if parent[node] != -1:
			visited[parent[node]] -= 1
			if not visited[parent[node]]:
				q.append(parent[node])
		else:
			root = node
		for child in children[node]:
			downwards[node] = sorted([downwards[node][0], downwards[node][1], downwards[child][0] + 1], reverse=True)[0:2]
	s = [node]
	while s:
		node = s.pop()
		if parent[node] != -1:
			if downwards[parent[node]][0] == downwards[node][0] + 1:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][1])
			else:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][0])
		longest_path[node] = downwards[node][0] + downwards[node][1] + upward[node] - min([downwards[node][0], downwards[node][1], upward[node]]) - 1
		for child in children[node]:
			s.append(child)
	return longest_path
(x1, y1) = li()
(x2, y2) = li()
x = abs(x1 - x2)
y = abs(y1 - y2)
print(max(x, y))


i = list(map(int, input().split()))
f = list(map(int, input().split()))
x = abs(i[0] - f[0])
y = abs(i[1] - f[1])
print(max(x, y))


(x1, y1) = [int(i) for i in input().split()]
(x2, y2) = [int(i) for i in input().split()]
dist = min(abs(x2 - x1), abs(y2 - y1))
if dist == abs(x2 - x1):
	dist += abs(y2 - y1) - dist
else:
	dist += abs(x2 - x1) - dist
print(dist)


(a1, b1) = map(int, input().split())
(a2, b2) = map(int, input().split())
x = abs(a1 - a2)
y = abs(b1 - b2)
print(max(x, y))


(x0, y0) = map(int, input().split())
(x1, y1) = map(int, input().split())
steps = max(abs(x0 - x1), abs(y0 - y1))
print(steps)


from sys import stdin as fin
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
(sx, sy) = (abs(x1 - x2), abs(y1 - y2))
print(min(sx, sy) + abs(sx - sy))


(x1, y1) = [int(x) for x in input().split()]
(x2, y2) = [int(x) for x in input().split()]
r = 0
if abs(x1 - x2) < abs(y1 - y2):
	r += abs(x1 - x2) + (abs(y1 - y2) - abs(x1 - x2))
elif abs(x1 - x2) > abs(y1 - y2):
	r += abs(y1 - y2) + (abs(x1 - x2) - abs(y1 - y2))
else:
	r += abs(x1 - x2)
print(r)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
a = abs(x2 - x1)
b = abs(y2 - y1)
M = max(a, b)
m = min(a, b)
ans = m + M - m
print(ans)


(x, y) = map(int, input().split())
(a, b) = map(int, input().split())
(d, e) = (abs(x - a), abs(y - b))
if d == e:
	print(d)
else:
	print(min(d, e) + abs(max(d, e) - min(d, e)))


import sys
input = lambda : sys.stdin.readline()
int_arr = lambda : list(map(int, input().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().split())
get_int = lambda : map(int, input().split())
get_flo = lambda : map(float, input().split())
mod = 1000000007

def solve():
	pass
(a, b) = get_int()
(x, y) = get_int()
print(max(abs(a - x), abs(b - y)))


def dist(x1, y1, x2, y2):
	return max(abs(x1 - x2), abs(y1 - y2))
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
print(dist(x1, y1, x2, y2))


I = lambda : map(int, input().split())
(a1, b1) = I()
(a2, b2) = I()
print(max(abs(a1 - a2), abs(b1 - b2)))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
a = b = 0
if x1 > x2:
	a = x1 - x2
else:
	a = x2 - x1
if y1 > y2:
	b = y1 - y2
else:
	b = y2 - y1
print(max(a, b))


(xf, yf) = input().split()
(xf, yf) = (int(xf), int(yf))
(xt, yt) = input().split()
(xt, yt) = (int(xt), int(yt))
print(abs(xf - xt) + abs(yf - yt) - min(abs(xf - xt), abs(yf - yt)))


import math
(x1, y1) = list(map(int, input().split()))
(x2, y2) = list(map(int, input().split()))
c = math.fabs(x2 - x1)
d = math.fabs(y2 - y1)
print(int(max(c, d)))


(a, b) = map(int, input().split())
(c, d) = map(int, input().split())
g = abs(c - a)
h = abs(d - b)
x = max(g, h)
y = min(g, h)
z = abs(x - y)
if g == h:
	print(g)
else:
	print(y + z)


s1 = input().split()
s2 = input().split()
x1 = int(s1[0])
y1 = int(s1[1])
x2 = int(s2[0])
y2 = int(s2[1])
dx = abs(x2 - x1)
dy = abs(y2 - y1)
print(max(dx, dy))


s1 = input()
s2 = input()
dx = abs(int(s1[:s1.index(' ')]) - int(s2[:s2.index(' ')]))
dy = abs(int(s1[s1.index(' ') + 1:]) - int(s2[s2.index(' ') + 1:]))
print(max(dx, dy))


d1 = [int(x) for x in input().split()]
d2 = [int(x) for x in input().split()]
print(max(abs(d1[0] - d2[0]), abs(d1[1] - d2[1])))


(a, b) = map(int, input().split())
(x, y) = map(int, input().split())
x = abs(x - a)
y = abs(y - b)
print(min(x, y) + abs(x - y))


(ans_x, ans_y) = map(int, input().split())
(x, y) = map(int, input().split())
print(max(abs(ans_x - x), abs(ans_y - y)))


(x, y) = map(int, input().split())
(a, b) = map(int, input().split())
s = abs(x - a)
e = abs(y - b)
print(max(s, e))


(x1, y1) = list(map(int, input().split(' ')))
(x2, y2) = list(map(int, input().split(' ')))
result1 = max(x1, x2) - min(x1, x2)
result2 = max(y1, y2) - min(y1, y2)
print(max(result1, result2))


import math
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
d = 0
xd = math.fabs(x1 - x2)
yd = math.fabs(y1 - y2)
d = int(max(xd, yd))
print(d)


import sys
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
dif1 = abs(x1 - x2)
dif2 = abs(y1 - y2)
ans = max(dif1, dif2)
print(ans)


def main():
	(x, y) = map(int, input().split())
	(u, v) = map(int, input().split())
	print(max(abs(x - u), abs(y - v)))
main()


(a, b) = map(int, input().split())
(x, y) = map(int, input().split())
a = a - x
if a < 0:
	a *= -1
b = b - y
if b < 0:
	b *= -1
print(max(a, b))


(a, b) = map(int, input().split())
(m, n) = map(int, input().split())
z = min(abs(m - a), abs(n - b)) + abs(abs(m - a) - abs(n - b))
print(z)


from collections import defaultdict
import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
print(max(abs(x1 - x2), abs(y1 - y2)))


(x, y) = map(int, input().split())
(x2, y2) = map(int, input().split())
print(max(max(x, x2) - min(x, x2), max(y, y2) - min(y, y2)))


(n, m) = (int(x) for x in input().split())
(K, L) = (int(x) for x in input().split())
x = abs(K - n)
y = abs(L - m)
M = max(x, y)
print(M)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
if x2 - x1 >= 0 and y2 - y1 >= 0:
	if x2 - x1 < y2 - y1:
		print(y2 - y1)
	else:
		print(x2 - x1)
elif abs(x2 - x1) < abs(y2 - y1):
	print(abs(y2 - y1))
else:
	print(abs(x2 - x1))


import sys
line1 = sys.stdin.readline().rstrip('\n').split(' ')
line2 = sys.stdin.readline().rstrip('\n').split(' ')
x1 = int(line1[0])
y1 = int(line1[1])
x2 = int(line2[0])
y2 = int(line2[1])
diagonalSteps = min(abs(y2 - y1), abs(x2 - x1))
remainingSteps = max(abs(y2 - y1), abs(x2 - x1)) - diagonalSteps
print(diagonalSteps + remainingSteps)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
s1 = min(abs(x1 - x2), abs(y1 - y2))
s2 = abs(abs(x1 - x2) - abs(y1 - y2))
print(s1 + s2)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
min_x = int(abs(x2 - x1))
min_y = int(abs(y2 - y1))
steps = max(min_x, min_y)
print(steps)


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
(x1, y1) = read_ints()
(x2, y2) = read_ints()
print(max(abs(x2 - x1), abs(y2 - y1)))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
(diff1, diff2) = (abs(x1 - x2), abs(y2 - y1))
if diff1 < diff2:
	(diff1, diff2) = (diff2, diff1)
print(diff1 - diff2 + diff2)


def robot_move(x, y, a, b):
	return max(abs(x - a), abs(y - b))
(x, y) = map(int, input().split())
(a, b) = map(int, input().split())
print(robot_move(x, y, a, b))


(a, b) = map(int, input().split())
(a1, b1) = map(int, input().split())
t = 0
k = abs(a - a1)
t = abs(a - a1)
k2 = abs(b - b1)
if k2 - t <= 0:
	k2 = 0
else:
	k2 = k2 - t
print(k2 + k)


def main():
	[x1, y1] = [int(_) for _ in input().split()]
	[x2, y2] = [int(_) for _ in input().split()]
	distance_x = abs(x1 - x2)
	distance_y = abs(y1 - y2)
	result = min(distance_x, distance_y) + abs(distance_x - distance_y)
	print(result)
main()


from math import *
(a, b) = input().split()
(c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = abs(a - c)
f = abs(b - d)
g = 0
if e >= f:
	print(e)
elif f >= e:
	print(f)


def solve():
	(x1, y1) = map(int, input().split())
	(x2, y2) = map(int, input().split())
	x_gap = abs(x1 - x2)
	y_gap = abs(y1 - y2)
	print(x_gap if x_gap > y_gap else y_gap)
solve()


def main():
	x = input()
	y = input()
	z = x.split() + y.split()
	z = [abs(int(z[0]) - int(z[2]))] + [abs(int(z[1]) - int(z[3]))]
	print(max(z))
main()


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
p = 0
a = [x1, x2]
b = [y1, y2]
a.sort()
b.sort()
c = a[1] - a[0]
d = b[1] - b[0]
if c < d:
	d -= c
	p = p + c + d
elif d < c:
	c -= d
	p = p + c + d
else:
	p = d
print(p)


(x, y) = map(int, input().split())
(x1, y1) = [int(k) for k in input().split()]
print(max(abs(x - x1), abs(y - y1)))


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
minn = min(abs(x1 - x2), abs(y1 - y2))
(a1, b1) = (x1 + minn, y1 + minn)
(a2, b2) = (x1 - minn, y1 + minn)
(a3, b3) = (x1 - minn, y1 - minn)
(a4, b4) = (x1 + minn, y1 - minn)
ans = abs(x2 - a1) + abs(y2 - b1)
ans = min(ans, abs(x2 - a2) + abs(y2 - b2))
ans = min(ans, abs(x2 - a3) + abs(y2 - b3))
ans = min(ans, abs(x2 - a4) + abs(y2 - b4))
print(ans + minn)


def distancia():
	(x1, y1) = map(int, input().split())
	(x2, y2) = map(int, input().split())
	x = abs(x2 - x1)
	y = abs(y2 - y1)
	if x == y:
		print(x)
		return
	if x < y:
		print(y - x + x)
		return
	elif x > y:
		print(x - y + y)
		return
distancia()


(x, y) = map(int, input().split())
(x1, y1) = map(int, input().split())
r1 = abs(x1 - x)
r2 = abs(y1 - y)
print(max(r1, r2))


(x1, y1) = [int(t) for t in input().split()]
(x2, y2) = [int(t) for t in input().split()]
dx = abs(x2 - x1)
dy = abs(y2 - y1)
print(max(dx, dy))


(x1, y1) = [int(i) for i in input().split()]
(x2, y2) = [int(i) for i in input().split()]
d1 = abs(x1 - x2)
d2 = abs(y1 - y2)
if d1 < d2:
	print(d1 + d2 - d1)
else:
	print(d2 + d1 - d2)


(x, y) = map(int, input().split(' '))
(x1, y1) = map(int, input().split(' '))
if abs(x1 - x) > abs(y1 - y):
	print(abs(x1 - x))
else:
	print(abs(y1 - y))


sLine = input()
sSplit = sLine.split()
x1 = int(sSplit[0])
y1 = int(sSplit[1])
sLine = input()
sSplit = sLine.split()
x2 = int(sSplit[0])
y2 = int(sSplit[1])
d = max(abs(x2 - x1), abs(y2 - y1))
print(d)


def main():
	(x1, y1) = input().split()
	(x1, y1) = (int(x1), int(y1))
	(x2, y2) = input().split()
	(x2, y2) = (int(x2), int(y2))
	result = max(abs(x1 - x2), abs(y1 - y2))
	print(result)
main()


(n, m) = map(int, input().split())
(p, q) = map(int, input().split())
t = abs(n - p)
y = abs(m - q)
print(max(t, y))


i = lambda : map(int, input().split())
(a, b) = i()
(c, d) = i()
print(max(abs(c - a), abs(d - b)))


(xi, yi) = map(int, input().split())
(xf, yf) = map(int, input().split())
xf = abs(xf - xi)
yf = abs(yf - yi)
steps = 0
if xf == yf:
	steps += xf
elif xf == 0:
	steps += yf
elif yf == 0:
	steps += xf
else:
	reduce = min(xf, yf)
	steps += reduce
	steps += max(xf, yf) - reduce
print(steps)


l1 = input().split(' ')
l2 = input().split(' ')
x1 = int(l1[0])
y1 = int(l1[1])
x2 = int(l2[0])
y2 = int(l2[1])
c = 0
if x1 != x2 and y1 != y2:
	if x2 > x1 and y2 > y1:
		c = min(x2 - x1, y2 - y1)
		x2 = x2 - c
		y2 = y2 - c
		if x1 != x2:
			c = c + x2 - x1
		else:
			c = c + y2 - y1
	elif x1 > x2 and y1 > y2:
		c = min(x1 - x2, y1 - y2)
		x1 = x1 - c
		y1 = y1 - c
		if x1 != x2:
			c = c + x1 - x2
		else:
			c = c + y1 - y2
	elif x1 < x2 and y1 > y2:
		c = min(x2 - x1, y1 - y2)
		x1 = x1 + c
		y1 = y1 - c
		if x1 != x2:
			c = c + x2 - x1
		else:
			c = c + y1 - y2
	elif x2 < x1 and y2 > y1:
		c = min(x1 - x2, y2 - y1)
		x1 = x1 - c
		y1 = y1 + c
		if x1 != x2:
			c = c - x2 + x1
		else:
			c = c - y1 + y2
elif x1 == x2:
	c = abs(y1 - y2)
elif y1 == y2:
	c = abs(x1 - x2)
print(c)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
mindiff = min(abs(x1 - x2), abs(y1 - y2))
ans = mindiff
ans += abs(x1 - x2) - mindiff
ans += abs(y1 - y2) - mindiff
print(ans)


import sys
import math
import bisect
import itertools
import random
import re

def main():
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	C = [abs(A[0] - B[0]), abs(A[1] - B[1])]
	print(max(C))
main()


def c(a, b):
	if a - b > 0:
		return a - b
	else:
		return b - a
(x, y) = [int(i) for i in input().split()]
(k, l) = [int(i) for i in input().split()]
d = c(y, l)
e = c(x, k)
if d > e:
	print(d)
else:
	print(e)


start = list(map(int, input().split()))
end = list(map(int, input().split()))
maxdist = 0
if abs(start[0] - end[0]) > maxdist:
	maxdist = abs(start[0] - end[0])
if abs(start[1] - end[1]) > maxdist:
	maxdist = abs(start[1] - end[1])
print(maxdist)


(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
lx = abs(x1 - x2)
ly = abs(y1 - y2)
print(max(lx, ly))


(x, y) = map(int, input().split())
(n, m) = map(int, input().split())
t = abs(x - n)
k = abs(y - m)
if t > k:
	print(t)
else:
	print(k)


a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
print(max((abs(x - y) for (x, y) in zip(a, b))))


(x1, y1) = tuple(input().split())
(x2, y2) = tuple(input().split())
print(max(abs(int(x1) - int(x2)), abs(int(y1) - int(y2))))


x1 = list(map(int, input().split()))
f1 = list(map(int, input().split()))
n1 = f1[0] - x1[0]
n2 = f1[1] - x1[1]
print(max(abs(n1), abs(n2)))


x = [int(s) for s in input().split(' ')]
y = [int(s) for s in input().split(' ')]
ans = max(abs(x[0] - y[0]), abs(x[1] - y[1]))
print(ans)


n = [int(x) for x in input().split()]
m = [int(x) for x in input().split()]
if n[0] >= 0:
	m[0] = m[0] - n[0]
else:
	m[0] = m[0] + abs(n[0])
if n[1] >= 0:
	m[1] = m[1] - n[1]
else:
	m[1] = m[1] + abs(n[1])
print(max(abs(m[0]), abs(m[1])))


class Solver:

	def __init__(self, x1, y1, x2, y2):
		self.x1 = x1
		self.y1 = y1
		self.x2 = x2
		self.y2 = y2

	def do(self):
		d1 = abs(self.x1 - self.x2)
		d2 = abs(self.y1 - self.y2)
		d = max(d1, d2)
		return d

class Inputer:

	def __init__(self):
		self.sLine1 = input()
		self.sLine2 = input()

	def do(self):
		sSplit1 = self.sLine1.split()
		x1 = int(sSplit1[0])
		y1 = int(sSplit1[1])
		sSplit2 = self.sLine2.split()
		x2 = int(sSplit2[0])
		y2 = int(sSplit2[1])
		return (x1, y1, x2, y2)
inputer = Inputer()
solver = Solver(*inputer.do())
print(solver.do())


import math
A = input().split()
x1 = int(A[0])
y1 = int(A[1])
A = input().split()
x2 = int(A[0])
y2 = int(A[1])
dx = abs(x1 - x2)
dy = abs(y1 - y2)
ans = max(dx, dy)
print(ans)


__author__ = 'Admin'
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
(dx, dy) = (max(x1, x2) - min(x1, x2), max(y1, y2) - min(y1, y2))
print(max(dx, dy))


(x1, y1) = map(int, input().split(' '))
(x2, y2) = map(int, input().split(' '))
res = 0
if int(((x1 - x2) ** 2) ** 0.5) > res:
	res = int(((x1 - x2) ** 2) ** 0.5)
if int(((y1 - y2) ** 2) ** 0.5) > res:
	res = int(((y1 - y2) ** 2) ** 0.5)
print(res)