The Chessboard Distance for any two points (X_{1}, Y_{1}) and (X_{2}, Y_{2}) on a Cartesian plane is defined as max(|X_{1} - X_{2}|, |Y_{1} - Y_{2}|). 

You are given two points (X_{1}, Y_{1}) and (X_{2}, Y_{2}). Output their Chessboard Distance. 

Note that, |P| denotes the absolute value of integer P. For example, |-4| = 4 and |7| = 7.

------ Input Format ------ 

- First line will contain T, the number of test cases. Then the test cases follow.
- Each test case consists of a single line of input containing 4 space separated integers - X_{1}, Y_{1}, X_{2}, Y_{2} - as defined in the problem statement.

------ Output Format ------ 

For each test case, output in a single line the chessboard distance between (X_{1}, Y_{1}) and (X_{2}, Y_{2})

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ X_{1}, Y_{1}, X_{2}, Y_{2} ≤ 10^{5}$

------ subtasks ------ 

Subtask #1 (100 points): original constraints

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

----- Sample Output 1 ------ 
3
2
2

----- explanation 1 ------ 
- In the first case, the distance between $(2, 4)$ and $(5, 1)$ is $max(|2- 5|, |4 - 1|) = max(|-3|, |3|) = 3$.

- In the second case, the distance between $(5, 5)$ and $(5, 3)$ is $max(|5- 5|, |5 - 3|) = max(|0|, |2|) = 2$.

- In the third case, the distance between $(1, 4)$ and $(3, 3)$ is $max(|1- 3|, |4 - 3|) = max(|-2|, |1|) = 2$.

Source: codechef | Difficulty: EASY


Solutions:
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split(' '))
	if a > c:
		k = a - c
	else:
		k = c - a
	if b > d:
		l = b - d
	else:
		l = d - b
	m = max(k, l)
	print(m)


for _ in range(int(input())):
	(X1, Y1, X2, Y2) = map(int, input().split())
	X = X1 - X2
	Y = Y1 - Y2
	print(max(abs(X), abs(Y)))


T = int(input())
for i in range(T):
	(X1, Y1, X2, Y2) = map(int, input().split())
	print(max(abs(X1 - X2), abs(Y1 - Y2)))


testcase = int(input())
while testcase > 0:
	(x1, y1, x2, y2) = map(int, input().split())
	print(max(abs(x1 - x2), abs(y1 - y2)))
	testcase -= 1


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


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	d1 = abs(x1 - x2)
	d2 = abs(y1 - y2)
	print(max(d1, d2))


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


for t in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	(a, b) = (abs(x1 - x2), abs(y1 - y2))
	print(max(a, b))


t = int(input())
for i in range(0, t):
	dist = list(map(int, input().split()))
	x = abs(dist[0] - dist[2])
	y = abs(dist[1] - dist[3])
	print(max(x, y))


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	a = x1 - x2
	b = y1 - y2
	if a < 0:
		a = -a
	if b < 0:
		b = -b
	if a >= b:
		print(a)
	else:
		print(b)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	dis1 = abs(x1 - x2)
	dis2 = abs(y1 - y2)
	if dis1 == dis2:
		print(dis1)
	else:
		print(max(dis1, dis2))


n = int(input())
for i in range(n):
	(a, b, c, d) = map(int, input().split())
	x = abs(a - c)
	y = abs(b - d)
	z = max(x, y)
	print(z)


for i in range(int(input())):
	(x, y, x1, y1) = map(int, input().split())
	print(max(abs(x - x1), abs(y - y1)))


t = int(input())
for i in range(t):
	(x1, x2, y1, y2) = map(int, input().split())
	x_dist = abs(x1 - y1)
	y_dist = abs(x2 - y2)
	dist = max(x_dist, y_dist)
	print(dist)


for j in range(int(input())):
	(a1, b1, a2, b2) = map(int, input().split())
	print(max(abs(a1 - a2), abs(b1 - b2)))


for _ in range(int(input())):
	(x1, x2, x3, x4) = map(int, input().split())
	print(max(abs(x1 - x3), abs(x2 - x4)))


for t in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	if x1 > x2:
		if y1 > y2:
			print(max(x1 - x2, y1 - y2))
		else:
			print(max(x1 - x2, y2 - y1))
	elif y1 > y2:
		print(max(x2 - x1, y1 - y2))
	else:
		print(max(x2 - x1, y2 - y1))


t = int(input())
for i in range(t):
	(X1, Y1, X2, Y2) = map(int, input().split())
	Xcoord = abs(X1 - X2)
	Ycoord = abs(Y1 - Y2)
	print(max(Xcoord, Ycoord))


t = int(input())
for _ in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	print(max(abs(x1 - x2), abs(y1 - y2)))


import math
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	print(max(abs(a - c), abs(b - d)))


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	print(max(abs(a - x), abs(y - b)))


for i in range(int(input())):
	a = list(map(int, input().split()))
	x1 = a[0]
	y1 = a[1]
	x2 = a[2]
	y2 = a[3]
	print(max(abs(x1 - x2), abs(y1 - y2)))


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	d = abs(a - x)
	e = abs(b - y)
	if d > e:
		print(d)
	else:
		print(e)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	c = x1 - x2
	d = y1 - y2
	if c < 0:
		c = -c
	if d < 0:
		d = -d
	if c >= d:
		print(c)
	else:
		print(d)


for i in range(int(input())):
	(x1, y1, x2, y2) = map(int, input().split())
	dis_x = abs(x1 - x2)
	dis_y = abs(y1 - y2)
	if dis_x < 0:
		dis_x = dis_x * -1
	elif dis_y < 0:
		dis_y = dis_y * -1
	else:
		dis_y = dis_y
		dis_x = dis_x
	if dis_x == dis_y:
		print(dis_x)
	else:
		print(max(dis_x, dis_y))


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	(m, n) = (abs(a - c), abs(b - d))
	print(max(m, n))


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	a = abs(x1 - x2)
	b = abs(y1 - y2)
	if a >= b:
		print(abs(a))
	elif a <= b:
		print(abs(b))


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	n = abs(a - c)
	m = abs(b - d)
	if m > n:
		print(m)
	else:
		print(n)


T = int(input())
for i in range(T):
	(x1, y1, x2, y2) = map(int, input().split(' '))
	a = abs(x1 - x2)
	b = abs(y1 - y2)
	if a > b:
		print(a)
	else:
		print(b)


t = int(input())
for i in range(t):
	(x1, x2, y1, y2) = map(int, input().split())
	z = abs(x1 - y1)
	z1 = abs(x2 - y2)
	z2 = max(z, z1)
	print(z2)


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	(x3, y3) = (x2 - x1, y2 - y1)
	(a, b) = (abs(x3), abs(y3))
	c = []
	c.append(a)
	c.append(b)
	print(max(c))


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


test = int(input())
for i in range(test):
	(x1, y1, x2, y2) = map(int, input().split())
	p1 = abs(x1 - x2)
	p2 = abs(y1 - y2)
	print(max(p1, p2))


for i in range(int(input())):
	(w, x, y, z) = map(int, input().split())
	print(max(abs(w - y), abs(x - z)))


n = int(input())
for i in range(0, n):
	(a, b, c, d) = map(int, input().split())
	k = a - c
	f = b - d
	if k < 0:
		k = -k
	if f < 0:
		f = -f
	if k > f:
		print(k)
	else:
		print(f)


t = int(input())
for _ in range(t):
	marks = list(map(int, input().split(' ')))
	distance = lambda x: max(abs(x[0] - x[2]), abs(x[1] - x[3]))
	print(distance(marks))


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = list(map(int, input().split()))
	if x1 > x2:
		s1 = x1 - x2
	else:
		s1 = x2 - x1
	if y1 > y2:
		s2 = y1 - y2
	else:
		s2 = y2 - y1
	print(max(s1, s2))


t = int(input())
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split(' '))
	xval = x1 - x2
	yval = y1 - y2
	print(max(abs(xval), abs(yval)))


t = int(input())
max = 0
for i in range(t):
	(x1, y1, x2, y2) = map(int, input().split())
	q1 = abs(x1 - x2)
	q2 = abs(y1 - y2)
	if q1 > q2:
		max = q1
	else:
		max = q2
	print(max)


T = int(input())
for _ in range(T):
	(x1, y1, x2, y2) = map(int, input().split(' '))
	if x1 > x2 and y1 > y2:
		if x1 - x2 > y1 - y2:
			print(x1 - x2)
		else:
			print(y1 - y2)
	elif x1 > x2 and y1 < y2:
		if x1 - x2 > y2 - y1:
			print(x1 - x2)
		else:
			print(y2 - y1)
	elif x1 < x2 and y1 > y2:
		if x2 - x1 > y1 - y2:
			print(x2 - x1)
		else:
			print(y1 - y2)
	elif x1 < x2 and y1 < y2:
		if x2 - x1 > y2 - y1:
			print(x2 - x1)
		else:
			print(y2 - y1)
	elif x1 == x2:
		if 0 < y1 - y2:
			print(y1 - y2)
		else:
			print(y2 - y1)
	elif y1 == y2:
		if x1 - x2 > o:
			print(x1 - x2)
		else:
			print(x2 - x1)


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	p = abs(a - c)
	q = abs(b - d)
	print(max(p, q))


T = int(input())
for i in range(T):
	(x1, y1, x2, y2) = map(int, input().split())
	r = abs(x1 - x2)
	s = abs(y1 - y2)
	print(max(r, s))


T = int(input())
for i in range(T):
	(A, B, C, D) = map(int, input().split())
	X = abs(A - C)
	Y = abs(B - D)
	if X > Y:
		print(X)
	else:
		print(Y)