Little Petya is learning to play chess. He has already learned how to move a king, a rook and a bishop. Let us remind you the rules of moving chess pieces. A chessboard is 64 square fields organized into an 8 × 8 table. A field is represented by a pair of integers (r, c) — the number of the row and the number of the column (in a classical game the columns are traditionally indexed by letters). Each chess piece takes up exactly one field. To make a move is to move a chess piece, the pieces move by the following rules:  A rook moves any number of fields horizontally or vertically.  A bishop moves any number of fields diagonally.  A king moves one field in any direction — horizontally, vertically or diagonally.  [Image] The pieces move like that 

Petya is thinking about the following problem: what minimum number of moves is needed for each of these pieces to move from field (r_1, c_1) to field (r_2, c_2)? At that, we assume that there are no more pieces besides this one on the board. Help him solve this problem.


-----Input-----

The input contains four integers r_1, c_1, r_2, c_2 (1 ≤ r_1, c_1, r_2, c_2 ≤ 8) — the coordinates of the starting and the final field. The starting field doesn't coincide with the final one.

You can assume that the chessboard rows are numbered from top to bottom 1 through 8, and the columns are numbered from left to right 1 through 8.


-----Output-----

Print three space-separated integers: the minimum number of moves the rook, the bishop and the king (in this order) is needed to move from field (r_1, c_1) to field (r_2, c_2). If a piece cannot make such a move, print a 0 instead of the corresponding number.


-----Examples-----
Input
4 3 1 6

Output
2 1 3

Input
5 5 5 6

Output
1 0 1

Source: codeforces | Difficulty: EASY
Tags: Graph algorithms

Mathematics

Shortest paths


Solutions:
(r1, c1, r2, c2) = map(int, input().split())
a = []
if r1 == r2 or c1 == c2:
	a.append(1)
else:
	a.append(2)
if abs(r1 - r2) == abs(c1 - c2):
	a.append(1)
elif (r1 + c1) % 2 == 0 and (r2 + c2) % 2 != 0 or ((r1 + c1) % 2 != 0 and (r2 + c2) % 2 == 0):
	a.append(0)
else:
	a.append(2)
if abs(r1 - r2) == abs(c1 - c2):
	a.append(abs(r1 - r2))
else:
	a.append(max(abs(r1 - r2), abs(c1 - c2)))
print(*a)


def is_black(x, y):
	is_x_odd = x % 2 != 0
	is_y_odd = y % 2 != 0
	return is_x_odd != is_y_odd

def solve(x1, y1, x2, y2):
	v1 = 2
	v2 = 0
	v3 = 0
	if x1 == x2 and y1 == y2:
		return (0, 0, 0)
	if x1 == x2 or y1 == y2:
		v1 = 1
	p1 = is_black(x1, y1)
	p2 = is_black(x2, y2)
	if p1 == p2:
		if abs(x1 - x2) == abs(y1 - y2):
			v2 = 1
		else:
			v2 = 2
	while x1 != x2 or y1 != y2:
		arr = [[x1, y1], [x1 - 1, y1], [x1 - 1, y1 - 1], [x1, y1 - 1], [x1 + 1, y1], [x1 + 1, y1 + 1], [x1, y1 + 1], [x1 + 1, y1], [x1 + 1, y1 - 1], [x1 - 1, y1 + 1]]
		min_val = 100000
		min_temp_x = 0
		min_temp_y = 0
		for i in arr:
			(temp_x, temp_y) = i
			val = (abs(temp_x - x2) ** 2 + abs(temp_y - y2) ** 2) ** 0.5
			if val < min_val:
				min_val = val
				min_temp_x = temp_x
				min_temp_y = temp_y
		x1 = min_temp_x
		y1 = min_temp_y
		v3 += 1
	return (v1, v2, v3)

def main():
	arr = list(map(int, list(input().split(' '))))
	print(*solve(*arr))
main()


(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2 or c1 == c2:
	print('1', end=' ')
else:
	print('2', end=' ')
if (r1 + c1) % 2 != (r2 + c2) % 2:
	print('0', end=' ')
elif r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
	print('1', end=' ')
else:
	print('2', end=' ')
print(max(abs(r1 - r2), abs(c1 - c2)))


def main():
	(r1, c1, r2, c2) = list(map(int, input().split()))
	(_1, _2, _3) = (2, 2, 0)
	if r1 == r2 or c1 == c2:
		_1 = 1
	if (r1 + c1) % 2 != (r2 + c2) % 2:
		_2 = 0
	elif r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
		_2 = 1
	_3 = max(abs(r1 - r2), abs(c1 - c2))
	print(_1, _2, _3)

def __starting_point():
	main()
__starting_point()


(r1, c1, r2, c2) = map(int, input().split())
rook = 0
bishop = 0
king = 0
if r1 != r2:
	rook += 1
if c1 != c2:
	rook += 1
r_king = r1
c_king = c1
while r_king != r2 and c_king != c2:
	if r_king > r2:
		r_king -= 1
	else:
		r_king += 1
	if c_king > c2:
		c_king -= 1
	else:
		c_king += 1
	king += 1
king += abs(r_king - r2) + abs(c_king - c2)
if abs(r1 - r2) % 2 == abs(c1 - c2) % 2:
	if abs(r1 - r2) == abs(c1 - c2):
		bishop = 1
	else:
		bishop = 2
print(rook, bishop, king)


import sys
import math
(r1, c1, r2, c2) = [int(x) for x in sys.stdin.readline().split()]
res = []
if r1 == r2 and c1 == c2:
	print('0 0 0')
	exit()
if r1 == r2 or c1 == c2:
	res.append('1')
else:
	res.append('2')
f1 = (r1 + c1) % 2 == 0
f2 = (r2 + c2) % 2 == 0
if f1 != f2:
	res.append('0')
elif math.fabs(r1 - r2) == math.fabs(c1 - c2):
	res.append('1')
else:
	res.append('2')
res.append(str(int(max(math.fabs(r1 - r2), math.fabs(c1 - c2)))))
print(' '.join(res))


[r1, c1, r2, c2] = [int(i) for i in input().split()]
rook = 2
if r1 == r2 or c1 == c2:
	rook = 1
bishop = 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	bishop = 0
elif abs(r2 - r1) == abs(c2 - c1):
	bishop = 1
king = max(abs(r2 - r1), abs(c2 - c1))
print(rook, bishop, king)


(r1, c1, r2, c2) = list(map(int, input().split(' ')))
rook = 2
if r1 == r2 or c1 == c2:
	rook = 1
bishop = 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	bishop = 0
elif abs(r2 - r1) == abs(c2 - c1):
	bishop = 1
king = max([abs(r2 - r1), abs(c2 - c1)])
print(rook, bishop, king)


(r1, c1, r2, c2) = map(int, input().split())
t = 0
a = abs(r1 - r2)
b = abs(c1 - c2)
if (a - b) % 2 == 0:
	t = 2
if a == b:
	t = 1
print((r1 != r2) + (c1 != c2), t, max(a, b))


(a, b, c, d) = map(int, input().split())
e = abs(a - c)
f = abs(b - d)
t = 0
if (e - f) % 2 == 0:
	t = 2
if e == f:
	t = 1
print((a != c) + (b != d), t, max(e, f))


a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
x1 = a[0]
y1 = a[1]
x2 = a[2]
y2 = a[3]
ans1 = ans2 = ans3 = 0
if x1 != x2:
	ans1 += 1
if y1 != y2:
	ans1 += 1
buf1 = abs(x1 - x2)
buf2 = abs(y1 - y2)
if buf1 != buf2:
	if buf1 % 2 == buf2 % 2:
		ans2 = 2
else:
	ans2 = 1
ans3 = max(buf1, buf2)
print(ans1, ans2, ans3)


def MinSteps(SourceX, SourceY, DestX, DestY):
	print(max(abs(SourceX - DestX), abs(SourceY - DestY)))
(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2 or c1 == c2:
	rook = 1
else:
	rook = 2
(i, j) = (r1, c1)
result = False
bishop = 2
while i > 0 and j > 0:
	if (i, j) == (r2, c2):
		bishop = 1
		result = True
		break
	j -= 1
	i -= 1
if result:
	bishop = 1
else:
	(i, j) = (r1, c1)
	while i <= 8 and j <= 8:
		if (i, j) == (r2, c2):
			bishop = 1
			result = True
			break
		i += 1
		j += 1
	if result:
		bishop = 1
	else:
		(i, j) = (r1, c1)
		while i > 0 and j <= 8:
			if (i, j) == (r2, c2):
				bishop = 1
				result = True
				break
			i -= 1
			j += 1
		if result:
			bishop = 1
		else:
			(i, j) = (r1, c1)
			while i <= 8 and j > 0:
				if (i, j) == (r2, c2):
					result = True
					break
				i += 1
				j -= 1
			if result:
				bishop = 1
if (r1 + c1) % 2 != (r2 + c2) % 2:
	bishop = 0
print(rook, bishop, end=' ')
MinSteps(r1, c1, r2, c2)


(r1, c1, r2, c2) = map(int, input().split())
(h, b, k) = (0, 0, 0)
if r1 == r2 or c1 == c2:
	h = 1
else:
	h = 2
if (r1 % 2 == c1 % 2) == (r2 % 2 == c2 % 2):
	if abs(r1 - r2) == abs(c1 - c2):
		b = 1
	else:
		b = 2
else:
	b = 0
if r1 == r2 or c1 == c2:
	k = max(abs(r1 - r2), abs(c1 - c2))
elif r1 > r2 and c1 > c2:
	c = 0
	while 1:
		r1 = r1 - 1
		c1 = c1 - 1
		c = c + 1
		if r1 == r2 or c1 == c2:
			k = c + max(abs(r1 - r2), abs(c1 - c2))
			break
elif r1 < r2 and c1 < c2:
	c = 0
	while 1:
		r1 = r1 + 1
		c1 = c1 + 1
		c = c + 1
		if r1 == r2 or c1 == c2:
			k = c + max(abs(r1 - r2), abs(c1 - c2))
			break
elif r1 > r2 and c1 < c2:
	c = 0
	while 1:
		r1 = r1 - 1
		c1 = c1 + 1
		c = c + 1
		if r1 == r2 or c1 == c2:
			k = c + max(abs(r1 - r2), abs(c1 - c2))
			break
elif r1 < r2 and c1 > c2:
	c = 0
	while 1:
		r1 = r1 + 1
		c1 = c1 - 1
		c = c + 1
		if r1 == r2 or c1 == c2:
			k = c + max(abs(r1 - r2), abs(c1 - c2))
			break
print(h, b, k)


(a, b, c, d) = map(int, input().split())
if a == c or b == d:
	print(1, end=' ')
else:
	print(2, end=' ')
if (a + b) % 2 != (c + d) % 2:
	print(0, end=' ')
elif abs(a - c) == abs(b - d):
	print(1, end=' ')
else:
	print(2, end=' ')
if a == c:
	print(abs(b - d))
elif b == d:
	print(abs(a - c))
else:
	Min = min(abs(a - c), abs(b - d))
	if a > c:
		a -= Min
	else:
		a += Min
	if b > d:
		b -= Min
	else:
		b += Min
	if a == c:
		print(abs(b - d) + Min)
	else:
		print(abs(a - c) + Min)


def fn(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		rook = bishop = king = 0
		print(rook, bishop, king)
	if r1 == r2 or c1 == c2:
		rook = 1
	else:
		rook = 2
	if (r1 - c1) % 2 != (r2 - c2) % 2:
		bishop = 0
	elif r1 - r2 == c1 - c2 or r1 - r2 == c2 - c1:
		bishop = 1
	else:
		bishop = 2
	if r1 == r2:
		king = abs(c1 - c2)
	elif c1 == c2:
		king = abs(r1 - r2)
	elif r1 - r2 == c1 - c2 or r1 - r2 == c2 - c1:
		king = abs(r1 - r2)
	elif abs(r1 - r2) < abs(c1 - c2):
		king = abs(r1 - r2) + abs(c1 - c2) - abs(r1 - r2)
	else:
		king = abs(c1 - c2) + abs(r1 - r2) - abs(c1 - c2)
	print(rook, bishop, king)
(r1, c1, r2, c2) = input().split()
fn(int(r1), int(c1), int(r2), int(c2))


import math as m
(r1, c1, r2, c2) = map(int, input().split())
moves_rook = 0
(rook_horizontal, rook_vertical) = (r1, c1)
if c1 == c2 and r1 != r2:
	rook_horizontal += r2 - r1
	moves_rook += 1
elif r1 == r2 and c1 != c2:
	rook_horizontal += c2 - c1
	moves_rook += 1
else:
	rook_horizontal += r2 - r1
	moves_rook += 1
	rook_vertical += r2 - r1
	moves_rook += 1
moves_bishop = 0
(bishop_horizontal, bishop_vertical) = (r1, c1)
if (r1 + c1) % 2 == (r2 + c2) % 2:
	if int(m.fabs(r2 - r1)) == int(m.fabs(c2 - c1)):
		moves_bishop += 1
	else:
		moves_bishop += 2
moves_king = 0
(king_horizontal, king_vertical) = (r1, c1)
if int(m.fabs(r2 - r1)) == int(m.fabs(c2 - c1)):
	moves_king += int(m.fabs(c2 - c1))
elif c2 - c1 == 0 and int(m.fabs(r2 - r1)) != 0:
	moves_king += int(m.fabs(r2 - r1))
elif r2 - r1 == 0 and int(m.fabs(c2 - c1)) != 0:
	moves_king += int(m.fabs(c2 - c1))
elif c2 > c1:
	if r2 < r1:
		while king_horizontal != r2 and king_vertical != c2:
			king_horizontal -= 1
			king_vertical += 1
			moves_king += 1
		if king_horizontal == r2 and king_vertical != c2:
			moves_king += int(m.fabs(c2 - king_vertical))
		elif king_horizontal != r2 and king_vertical == c2:
			moves_king += int(m.fabs(r2 - king_horizontal))
	elif r2 > r1:
		while king_horizontal != r2 and king_vertical != c2:
			king_horizontal += 1
			king_vertical += 1
			moves_king += 1
		if king_horizontal == r2 and king_vertical != c2:
			moves_king += int(m.fabs(c2 - king_vertical))
		elif king_horizontal != r2 and king_vertical == c2:
			moves_king += int(m.fabs(r2 - king_horizontal))
elif c2 < c1:
	if r2 < r1:
		while king_horizontal != r2 and king_vertical != c2:
			king_horizontal -= 1
			king_vertical -= 1
			moves_king += 1
		if king_horizontal == r2 and king_vertical != c2:
			moves_king += int(m.fabs(c2 - king_vertical))
		elif king_horizontal != r2 and king_vertical == c2:
			moves_king += int(m.fabs(r2 - king_horizontal))
	elif r2 > r1:
		while king_horizontal != r2 and king_vertical != c2:
			king_horizontal += 1
			king_vertical -= 1
			moves_king += 1
		if king_horizontal == r2 and king_vertical != c2:
			moves_king += int(m.fabs(c2 - king_vertical))
		elif king_horizontal != r2 and king_vertical == c2:
			moves_king += int(m.fabs(r2 - king_horizontal))
print(moves_rook, moves_bishop, moves_king)


import math
import sys
from collections import defaultdict
from collections import Counter
from collections import deque
import bisect
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]
INF = 10 ** 18
MOD = 10 ** 9 + 7
(r1, c1, r2, c2) = ilele()
(Ans1, Ans2, Ans3) = (0, 0, 0)
if (r1, c1) == (r2, c2):
	print(0, 0, 0)
else:
	Ans1 = 2 - (r1 == r2) - (c1 == c2)
	if (r1 + c1) % 2 != (r2 + c2) % 2:
		Ans2 = 0
	else:
		if c1 != c2:
			y = (r2 - r1) / (c2 - c1)
		else:
			y = (c2 - c1) / (r1 - r2)
		if y == 1 or y == -1:
			Ans2 = 1
		else:
			Ans2 = 2
	z = min(abs(r1 - r2), abs(c1 - c2))
	Ans3 = abs(r1 - r2) + abs(c1 - c2) - z
	print(Ans1, Ans2, Ans3)


(sx, sy, ex, ey) = map(int, input().split())
rook = 1 if sx == ex or sy == ey else 2
bishop = 0
if abs(sx - ex) == abs(sy - ey):
	bishop = 1
elif (sx + sy) % 2 == (ex + ey) % 2:
	bishop = 2
king = max(abs(sx - ex), abs(sy - ey))
print(rook, bishop, king)


a = [int(i) for i in input().split()]
x1 = a[0]
y1 = a[1]
x2 = a[2]
y2 = a[3]
if x1 == x2 or y2 == y1:
	print(1, end=' ')
elif x1 != x2 and y2 != y1:
	print(2, end=' ')
if x1 + y1 == x2 + y2 or x1 - y1 == x2 - y2:
	print(1, end=' ')
elif (x1 + y1) % 2 != (x2 + y2) % 2:
	print(0, end=' ')
else:
	print(2)
print(max(abs(x1 - x2), abs(y1 - y2)), end=' ')


(r1, c1, r2, c2) = map(int, input().split())
Bishop = -1
if (r1 + c1) % 2 != (r2 + c2) % 2:
	Bishop = 0
elif abs(r2 - r1) == abs(c2 - c1):
	Bishop = 1
else:
	Bishop = 2
Rook = -1
if r1 == r2 or c1 == c2:
	Rook = 1
else:
	Rook = 2
King = max(abs(r1 - r2), abs(c1 - c2))
print(Rook, Bishop, King)


def solve_king(r1, c1, r2, c2):
	return max(abs(r1 - r2), abs(c1 - c2))

def solve_rook(r1, c1, r2, c2):
	return (r1 != r2) + (c1 != c2)

def solve_elephant(r1, c1, r2, c2):
	if (r1 + c1) % 2 == (r2 + c2) % 2:
		return 1 + (abs(r1 - r2) != abs(c1 - c2))
	return 0

def solve(r1, c1, r2, c2):
	king = solve_king(r1, c1, r2, c2)
	rook = solve_rook(r1, c1, r2, c2)
	elephant = solve_elephant(r1, c1, r2, c2)
	return f'{rook} {elephant} {king}'
(r1, r2, c1, c2) = map(int, input().split())
print(solve(r1, r2, c1, c2))


from queue import Queue

def rook(start_x, start_y, end_x, end_y, G):
	n = len(G)
	Q = Queue()
	G[start_y][start_x] = 0
	Q.put((start_y, start_x))
	while not Q.empty():
		(y, x) = Q.get()
		for i in range(n):
			if i == x or G[y][i] != -1:
				continue
			else:
				G[y][i] = G[y][x] + 1
				if y == end_y and i == end_x:
					return G[end_y][end_x]
				Q.put((y, i))
		for i in range(n):
			if i == y or G[i][x] != -1:
				continue
			else:
				G[i][x] = G[y][x] + 1
				if i == end_y and x == end_x:
					return G[end_y][end_x]
				Q.put((i, x))
	return 0

def bishop(start_x, start_y, end_x, end_y, G):
	n = len(G)
	Q = Queue()
	G[start_y][start_x] = 0
	Q.put((start_y, start_x))
	while not Q.empty():
		(y, x) = Q.get()
		for i in range(1, n):
			if y - i >= 0 and x - i >= 0 and (G[y - i][x - i] == -1):
				G[y - i][x - i] = G[y][x] + 1
				if y - i == end_y and x - i == end_x:
					return G[end_y][end_x]
				Q.put((y - i, x - i))
			if y + i < n and x + i < n and (G[y + i][x + i] == -1):
				G[y + i][x + i] = G[y][x] + 1
				if y + i == end_y and x + i == end_x:
					return G[end_y][end_x]
				Q.put((y + i, x + i))
			if y + i < n and x - i >= 0 and (G[y + i][x - i] == -1):
				G[y + i][x - i] = G[y][x] + 1
				if y + i == end_y and x - i == end_x:
					return G[end_y][end_x]
				Q.put((y + i, x - i))
			if y - i >= 0 and x + i < n and (G[y - i][x + i] == -1):
				G[y - i][x + i] = G[y][x] + 1
				if y - i == end_y and x + i == end_x:
					return G[end_y][end_x]
				Q.put((y - i, x + i))
	return 0

def king(start_x, start_y, end_x, end_y, G):
	n = len(G)
	Q = Queue()
	G[start_y][start_x] = 0
	Q.put((start_y, start_x))
	while not Q.empty():
		(y, x) = Q.get()
		if y - 1 >= 0 and x - 1 >= 0 and (G[y - 1][x - 1] == -1):
			G[y - 1][x - 1] = G[y][x] + 1
			if y - 1 == end_y and x - 1 == end_x:
				return G[end_y][end_x]
			Q.put((y - 1, x - 1))
		if y - 1 >= 0 and G[y - 1][x] == -1:
			G[y - 1][x] = G[y][x] + 1
			if y - 1 == end_y and x == end_x:
				return G[end_y][end_x]
			Q.put((y - 1, x))
		if y - 1 >= 0 and x + 1 < n and (G[y - 1][x + 1] == -1):
			G[y - 1][x + 1] = G[y][x] + 1
			if y - 1 == end_y and x + 1 == end_x:
				return G[end_y][end_x]
			Q.put((y - 1, x + 1))
		if x - 1 >= 0 and G[y][x - 1] == -1:
			G[y][x - 1] = G[y][x] + 1
			if y == end_y and x - 1 == end_x:
				return G[end_y][end_x]
			Q.put((y, x - 1))
		if x + 1 < n and G[y][x + 1] == -1:
			G[y][x + 1] = G[y][x] + 1
			if y == end_y and x + 1 == end_x:
				return G[end_y][end_x]
			Q.put((y, x + 1))
		if y + 1 < n and x - 1 >= 0 and (G[y + 1][x - 1] == -1):
			G[y + 1][x - 1] = G[y][x] + 1
			if y + 1 == end_y and x - 1 == end_x:
				return G[end_y][end_x]
			Q.put((y + 1, x - 1))
		if y + 1 < n and G[y + 1][x] == -1:
			G[y + 1][x] = G[y][x] + 1
			if y + 1 == end_y and x == end_x:
				return G[end_y][end_x]
			Q.put((y + 1, x))
		if y + 1 < n and x + 1 < n and (G[y + 1][x + 1] == -1):
			G[y + 1][x + 1] = G[y][x] + 1
			if y + 1 == end_y and x + 1 == end_x:
				return G[end_y][end_x]
			Q.put((y + 1, x + 1))
	return 0
(r1, c1, r2, c2) = map(int, input().split())
r1 -= 1
c1 -= 1
r2 -= 1
c2 -= 1
G = [[-1 for _ in range(8)] for _ in range(8)]
r = rook(c1, r1, c2, r2, G)
for i in range(8):
	for j in range(8):
		G[i][j] = -1
b = bishop(c1, r1, c2, r2, G)
for i in range(8):
	for j in range(8):
		G[i][j] = -1
k = king(c1, r1, c2, r2, G)
print(r, b, k)


import sys
import math
from collections import defaultdict
import heapq
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass

class Graph:

	def __init__(self, type):
		self.neighbours = defaultdict(list)
		if type == 0:
			self.addKing()
		elif type == 1:
			self.addRook()
		else:
			self.addBishop()

	def addKing(self):
		for x in range(1, 9):
			for y in range(1, 9):
				for i in range(-1, 2):
					for j in range(-1, 2):
						pos_x = x + i
						pos_y = y + j
						if self.isValid(pos_x, pos_y):
							self.addEdge([x, y], [pos_x, pos_y])

	def addRook(self):
		for x in range(1, 9):
			for y in range(1, 9):
				for pos_y in range(1, 9):
					if pos_y != y:
						self.addEdge([x, y], [x, pos_y])
		for x in range(1, 9):
			for y in range(1, 9):
				for pos_x in range(1, 9):
					if pos_x != x:
						self.addEdge([x, y], [pos_x, y])

	def addBishop(self):
		for x in range(1, 9):
			for y in range(1, 9):
				for posx in range(1, 9):
					for posy in range(1, 9):
						if abs(x - posx) == abs(y - posy):
							self.addEdge([x, y], [posx, posy])

	def addEdge(self, u, v):
		pos1 = self.ltos(u)
		pos2 = self.ltos(v)
		self.neighbours[pos1].append(pos2)
		self.neighbours[pos2].append(pos1)

	def ltos(self, l):
		return str(l[0]) + ':' + str(l[1])

	def isValid(self, x, y):
		if x < 1 or x > 8:
			return False
		if y < 1 or y > 8:
			return False
		return True

	def stol(self, s):
		return [int(s[0]), int(s[2])]

	def BFS(self, source, destination):
		source = self.ltos(source)
		destination = self.ltos(destination)
		visited = defaultdict(lambda : False)
		distance = defaultdict(lambda : float('inf'))
		distance[source] = 0
		visited[source] = True
		queue = [source]
		parent = defaultdict(lambda : None)
		while queue:
			u = queue.pop(0)
			if u == destination:
				break
			for v in self.neighbours[u]:
				if not visited[v]:
					visited[v] = True
					parent[v] = u
					distance[v] = distance[u] + 1
					queue.append(v)
		if distance[destination] == float('inf'):
			return 0
		return distance[destination]
(x1, y1, x2, y2) = [int(x) for x in input().split()]
source = [x1, y1]
destination = [x2, y2]
king = Graph(0)
rook = Graph(1)
bishop = Graph(2)
print(rook.BFS(source, destination), bishop.BFS(source, destination), king.BFS(source, destination))


def chess(r1, c1, r2, c2):
	if r1 == r2:
		val1 = 1
	elif c1 == c2:
		val1 = 1
	else:
		val1 = 2
	r1_par = r1 % 2 == 0
	c1_par = c1 % 2 == 0
	r2_par = r2 % 2 == 0
	c2_par = c2 % 2 == 0
	if r1_par == c1_par and r2_par == c2_par or (r1_par != c1_par and r2_par != c2_par):
		paso1 = abs(r1 - c1)
		paso2 = abs(r2 - c2)
		paso3 = abs(c1 + r1)
		paso4 = abs(c2 + r2)
		if paso1 == paso2 and r1 + c2 == r2 + c1:
			val2 = 1
		elif paso3 == paso4 and r1 + c1 == r2 + c2:
			val2 = 1
		else:
			val2 = 2
	else:
		val2 = 0
	row_king = abs(r1 - r2)
	col_king = abs(c1 - c2)
	if row_king >= col_king:
		val3 = row_king
	else:
		val3 = col_king
	print(str(val1) + ' ' + str(val2) + ' ' + str(val3))
(r11, c11, r22, c22) = input().split(' ')
r1 = int(r11)
c1 = int(c11)
r2 = int(r22)
c2 = int(c22)
chess(r1, c1, r2, c2)


def rook(a, b, c, d):
	res = 0
	if a != c:
		res += 1
	if b != d:
		res += 1
	return res

def bishop(a, b, c, d):
	res = 0
	if abs(a - c) == abs(b - d):
		res = 1
	elif abs(a - c) % 2 == 0 and abs(b - d) % 2 == 0 or (abs(a - c) % 2 == 1 and abs(b - d) % 2 == 1):
		res = 2
	return res
loc = input().split()
king = max(abs(int(loc[0]) - int(loc[2])), abs(int(loc[1]) - int(loc[3])))
print(rook(loc[0], loc[1], loc[2], loc[3]), bishop(int(loc[0]), int(loc[1]), int(loc[2]), int(loc[3])), king)


from sys import stdin
input = stdin.readline
(r1, c1, r2, c2) = [int(x) for x in input().split()]
ans = []
if r1 == r2 or c1 == c2:
	ans.append(1)
else:
	ans.append(2)
if (r1 + c1) % 2 != (r2 + c2) % 2:
	ans.append(0)
elif abs(r1 - r2) == abs(c1 - c2):
	ans.append(1)
else:
	ans.append(2)
min_ = min(abs(r1 - r2), abs(c1 - c2))
max_ = max(abs(r1 - r2), abs(c1 - c2))
ans.append(min_ + (max_ - min_))
print(*ans)


(r1, c1, r2, c2) = list(map(int, input().rstrip().split()))
hook = 0
if r1 != r2:
	hook += 1
if c1 != c2:
	hook += 1
bishop = 0
king = 0
r = abs(r1 - r2)
c = abs(c1 - c2)
king += min(r, c)
if r2 >= r1:
	rx = king + r1
else:
	rx = r1 - king
if c2 >= c1:
	cx = king + c1
else:
	cx = c1 - king
king += max(abs(r2 - rx), abs(c2 - cx))
if r == c:
	bishop = 1
elif (r + c) % 2 == 0:
	bishop = 2
else:
	bishop = 0
print(hook, bishop, king)


def nrook(r1, c1, r2, c2):
	if r1 == r2 or c1 == c2:
		return 1
	return 2

def nking(r1, c1, r2, c2):
	dr = abs(r1 - r2)
	dc = abs(c1 - c2)
	return dr + dc - min(dr, dc)

def iswhite(r, c):
	return c % 2 != 0 if r % 2 else c % 2 == 0

def nbishop(r1, c1, r2, c2):
	if iswhite(r1, c1) != iswhite(r2, c2):
		return 0
	if r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
		return 1
	return 2

def main():
	(r1, c1, r2, c2) = [int(x) - 1 for x in input().split()]
	rook = nrook(r1, c1, r2, c2)
	bishop = nbishop(r1, c1, r2, c2)
	king = nking(r1, c1, r2, c2)
	print(rook, bishop, king)
main()


(a, b, c, d) = map(int, input().split())
e = [0] * 3
if a == c:
	e[0] = str(1)
	e[2] = str(abs(b - d))
	if abs(b - d) % 2 == 0:
		e[1] = '2'
	else:
		e[1] = '0'
	print(' '.join(e))
elif b == d:
	e[0] = str(1)
	e[2] = str(abs(a - c))
	if abs(a - c) % 2 == 0:
		e[1] = '2'
	else:
		e[1] = '0'
	print(' '.join(e))
else:
	e[0] = '2'
	e[2] = str(max(abs(c - a), abs(d - b)))
	if (a + b) % 2 == (c + d) % 2:
		if abs(c - a) == abs(b - d):
			e[1] = '1'
		else:
			e[1] = '2'
	else:
		e[1] = '0'
	print(' '.join(e))


(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2 or c1 == c2:
	rook = 1
else:
	rook = 2
t1 = (r1 + c1) % 2
t2 = (r2 + c2) % 2
if t2 == t1:
	if abs(r1 - r2) == abs(c1 - c2):
		bishop = 1
	else:
		bishop = 2
else:
	bishop = 0
if r1 == r2:
	king = abs(c1 - c2)
elif c1 == c2:
	king = abs(r1 - r2)
elif abs(r1 - r2) == abs(c1 - c2):
	king = abs(r1 - r2)
else:
	king = max(abs(r1 - r2), abs(c2 - c1))
print(rook, bishop, king)


import sys
from math import *
z = 1
if z:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
mini = 9999999999
(r1, c1, r2, c2) = map(int, input().split())
b = r = k = 0
r = int(r1 != r2) + int(c1 != c2)
if r1 + c1 & 1 == r2 + c2 & 1:
	if abs(r1 - r2) == abs(c1 - c2):
		b = 1
	else:
		b = 2
mini = min(abs(r1 - r2), abs(c1 - c2))
maxi = max(abs(r1 - r2), abs(c1 - c2))
print(r, b, maxi)


(x, y, i, j) = map(int, input().split())
lis = [0, 0, 0]
if x == i or y == j:
	lis[0] = 1
	if x == i and (y - j) % 2 == 0 or (y == j and (x - i) % 2 == 0):
		lis[1] = 2
	else:
		lis[1] = 0
	if x == i:
		lis[2] = abs(y - j)
	else:
		lis[2] = abs(x - i)
else:
	lis[0] = 2
	if (x + i - (y + j)) % 2 == 0:
		if abs(x - i) == abs(y - j):
			lis[1] = 1
		else:
			lis[1] = 2
	else:
		lis[1] = 0
	if lis[1] == 1:
		lis[2] = abs(x - i)
	elif lis[1] == 2:
		lis[2] = max(abs(x - i), abs(y - j))
	else:
		lis[2] = max(abs(x - i), abs(y - j))
print(*lis)


(r1, c1, r2, c2) = list(map(int, input().split()))

def torre(r1, c1, r2, c2):
	if r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def arfil(r1, c1, r2, c2):
	p1 = r1 + c1
	p2 = r2 + c2
	if p1 % 2 != p2 % 2:
		return 0
	elif abs(r1 - r2) == abs(c1 - c2):
		return 1
	else:
		return 2

def rey(r1, c1, r2, c2):
	return max(abs(r1 - r2), abs(c1 - c2))

def minimos(r1, c1, r2, c2):
	t = torre(r1, c1, r2, c2)
	a = arfil(r1, c1, r2, c2)
	r = rey(r1, c1, r2, c2)
	return (t, a, r)
(torre, arfil, rey) = minimos(r1, c1, r2, c2)
print(torre, arfil, rey)


(r, c, x, y) = map(int, input().split())

def king(r, c, x, y):
	return max(abs(r - x), abs(c - y))

def bishop(r, c, x, y):
	if abs(y - c) == abs(x - r):
		return 1
	elif (abs(r - x) + abs(c - y)) % 2 == 1:
		return 0
	else:
		return 2

def rook(r, c, x, y):
	if r == x or c == y:
		return 1
	else:
		return 2
R = rook(r, c, x, y)
B = bishop(r, c, x, y)
K = king(r, c, x, y)
print(R, B, K)


from collections import deque

def valid(x, y):
	if x >= 9 or y >= 9 or x < 0 or (y < 0):
		return 0
	elif v1[x][y] == 1:
		return 0
	return 1

def king(i, j):
	v1[i][j] = True
	q = deque()
	q.append([i, j])
	dx = [1, 0, -1, 0, -1, -1, 1, 1]
	dy = [0, -1, 0, 1, -1, 1, -1, 1]
	while q:
		node = q.popleft()
		x = node[0]
		y = node[1]
		for i in range(8):
			if valid(x + dx[i], y + dy[i]):
				newx = x + dx[i]
				newy = y + dy[i]
				d1[newx][newy] = d1[x][y] + 1
				v1[newx][newy] = 1
				q.append([newx, newy])
(s1, s2, e1, e2) = map(int, input().split())
v1 = [[False for i in range(9)] for j in range(9)]
v2 = [[False for i in range(9)] for j in range(9)]
d1 = [[0 for i in range(9)] for j in range(9)]
king(s1, s2)
if s1 == e1 or s2 == e2:
	rook = 1
else:
	rook = 2
if (s1 + e1) % 2 != (s2 + e2) % 2:
	bishop = 0
elif s1 + s2 == e1 + e2 or s1 - s2 == e1 - e2:
	bishop = 1
else:
	bishop = 2
print(rook, bishop, d1[e1][e2])


(a, b, c, d) = map(int, input().split())
k = []
if a == c or b == d:
	k.append('1')
else:
	k.append('2')
x = a % 2
y = b % 2
z = c % 2
w = d % 2
if x == y and z == w or (x != y and z != w):
	if abs(a - c) == abs(d - b):
		k.append('1')
	else:
		k.append('2')
else:
	k.append('0')
k.append(str(max(abs(d - b), abs(a - c))))
print(' '.join(k))


(r1, c1, r2, c2) = map(int, input().split())

def f():
	if abs(r1 - r2) == abs(c1 - c2):
		return 1
	elif (r1 + c1) % 2 == (c2 + r2) % 2:
		return 2
	else:
		return 0

def k():
	dx = abs(r1 - r2)
	dy = abs(c1 - c2)
	return max(dx, dy)

def r():
	if r1 == r2 or c1 == c2:
		return 1
	else:
		return 2
print(r(), f(), k())


(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2 or c1 == c2:
	print(1, end=' ')
else:
	print(2, end=' ')
if (r1 + c1) % 2 != (r2 + c2) % 2:
	print(0, end=' ')
else:
	moves = []
	posibles = [(1, 1), (-1, -1), (-1, 1), (1, -1)]
	for k in posibles:
		for i in range(8):
			moves.append((r1 + k[0] * i, c1 + k[1] * i))
	if (r2, c2) in moves:
		print(1, end=' ')
	else:
		print(2, end=' ')
print(max([abs(r1 - r2), abs(c1 - c2)]))


__author__ = 'widoc'
(r1, c1, r2, c2) = map(int, input().split())
a1 = 1 if r1 == r2 or c1 == c2 else 2
a2 = 0
if abs(r1 - r2) == abs(c1 - c2):
	a2 = 1
elif (abs(r1 - r2) + abs(c1 - c2)) % 2 == 0:
	a2 = 2
a3 = max(abs(r1 - r2), abs(c1 - c2))
print(a1, a2, a3)


listwhite = []
listblack = []
for i in range(1, 9):
	if i % 2 == 0:
		k = 2
	else:
		k = 1
	for j in range(k, 9, 2):
		listwhite.append([i, j])
for i in range(1, 9):
	if i % 2 == 0:
		k = 1
	else:
		k = 2
	for j in range(k, 9, 2):
		listblack.append([i, j])
(x1, y1, x2, y2) = map(int, input().split())
if x1 == x2 and y1 != y2:
	rook = 1
elif y1 == y2 and x1 != x2:
	rook = 1
elif x1 != x2 and y1 != y2:
	rook = 2
else:
	rook = 0
if [x1, y1] in listwhite and [x2, y2] in listwhite:
	if abs(x1 - x2) == abs(y1 - y2):
		bishop = 1
	else:
		bishop = 2
elif [x1, y1] in listblack and [x2, y2] in listblack:
	if abs(x1 - x2) == abs(y1 - y2):
		bishop = 1
	else:
		bishop = 2
else:
	bishop = 0
if abs(x1 - x2) <= 1 and abs(y1 - y2) <= 1:
	count = 1
else:
	count = 0
	if x1 != x2 and y1 != y2:
		if x1 >= x2 and y1 >= y2:
			count1 = 0
			count2 = 0
			(temp1, temp2, temp3, temp4) = (x1, x2, y1, y2)
			while y1 != y2:
				count1 += 1
				y1 -= 1
				x1 -= 1
			count1 += abs(x1 - x2)
			(x1, x2, y1, y2) = (temp1, temp2, temp3, temp4)
			while x1 != x2:
				count2 += 1
				y1 -= 1
				x1 -= 1
			count2 += abs(y1 - y2)
			count = min(count1, count2)
		elif x1 <= x2 and y1 >= y2:
			count1 = 0
			count2 = 0
			(temp1, temp2, temp3, temp4) = (x1, x2, y1, y2)
			while y1 != y2:
				count1 += 1
				y1 -= 1
				x1 += 1
			count1 += abs(x1 - x2)
			(x1, x2, y1, y2) = (temp1, temp2, temp3, temp4)
			while x1 != x2:
				count2 += 1
				y1 -= 1
				x1 += 1
			count2 += abs(y1 - y2)
			count = min(count1, count2)
		elif x1 <= x2 and y1 <= y2:
			count1 = 0
			count2 = 0
			(temp1, temp2, temp3, temp4) = (x1, x2, y1, y2)
			while y1 != y2:
				count1 += 1
				y1 += 1
				x1 += 1
			count1 += abs(x1 - x2)
			(x1, x2, y1, y2) = (temp1, temp2, temp3, temp4)
			while x1 != x2:
				count2 += 1
				y1 += 1
				x1 += 1
			count2 += abs(y1 - y2)
			count = min(count1, count2)
		elif x1 >= x2 and y1 <= y2:
			count1 = 0
			count2 = 0
			(temp1, temp2, temp3, temp4) = (x1, x2, y1, y2)
			while y1 != y2:
				count1 += 1
				y1 += 1
				x1 -= 1
			count1 += abs(x1 - x2)
			(x1, x2, y1, y2) = (temp1, temp2, temp3, temp4)
			while x1 != x2:
				count2 += 1
				y1 += 1
				x1 -= 1
			count2 += abs(y1 - y2)
			count = min(count1, count2)
	else:
		count += abs(y1 - y2) + abs(x2 - x1)
print(rook, bishop, count)


(a, b, c, d) = map(int, input().split())
r_move = b_move = k_move = 0
if a == c or b == d:
	r_move = 1
else:
	r_move = 2
if abs(a - c) != abs(b - d) and (a + b) % 2 == (c + d) % 2:
	b_move = 2
elif abs(a - c) == abs(b - d):
	b_move = 1
else:
	b_move = 0
if a == c or b == d:
	k_move = max(abs(a - c), abs(b - d))
elif abs(a - c) == abs(b - d):
	k_move = min(abs(a - c), abs(b - d))
else:
	k_move = max(abs(a - c), abs(b - d))
print(r_move, b_move, k_move)


(r1, c1, r2, c2) = list(map(int, input().split()))
if r1 == r2 or c1 == c2:
	n1 = 1
else:
	n1 = 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	n2 = 0
elif r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
	n2 = 1
else:
	n2 = 2
print(n1, n2, max(abs(r1 - r2), abs(c1 - c2)))


def benteng(x1, y1, x2, y2):
	if x1 == x2 or y1 == y2:
		return 1
	else:
		return 2

def mentri(x1, y1, x2, y2):
	if abs(x1 - x2) == abs(y1 - y2):
		return 1
	if (abs(x1 - x2) + abs(y1 - y2)) % 2 == 0:
		return 2
	return 0

def raja(x1, y1, x2, y2):
	a = abs(x1 - x2)
	b = abs(y1 - y2)
	if a > b:
		return a
	else:
		return b
tp = str(input()).split()
print(benteng(int(tp[0]), int(tp[1]), int(tp[2]), int(tp[3])), mentri(int(tp[0]), int(tp[1]), int(tp[2]), int(tp[3])), raja(int(tp[0]), int(tp[1]), int(tp[2]), int(tp[3])))


(r1, c1, r2, c2) = [int(y) for y in input().split()]
rook_moves = 0
if r1 != r2:
	rook_moves += 1
if c1 != c2:
	rook_moves += 1
print(rook_moves, end=' ')
bishop_moves = 0
if (r1 + c1) % 2 != (r2 + c2) % 2:
	pass
elif r1 - c1 == r2 - c2 or r1 + c1 == r2 + c2:
	bishop_moves += 1
else:
	bishop_moves += 2
print(bishop_moves, end=' ')
king_moves = 0
king_moves += max(abs(r2 - r1), abs(c2 - c1))
print(king_moves)


(r1, c1, r2, c2) = map(int, input().split())
if (r1 + c1) % 2 != (r2 + c2) % 2:
	b = 0
elif abs(r1 - r2) == abs(c1 - c2):
	b = 1
else:
	b = 2
if r1 == r2 or c1 == c2:
	r = 1
else:
	r = 2
x = abs(r1 - r2)
y = abs(c1 - c2)
k = max(x, y)
print(r, b, k)


(x1, y1, x2, y2) = list(map(int, input().split()))
arr = [min(abs(x1 - x2), 1) + min(abs(y1 - y2), 1), 0, max(abs(y2 - y1), abs(x2 - x1))]
if x1 & 1 ^ y1 & 1 == x2 & 1 ^ y2 & 1:
	if abs(x1 - x2) == abs(y1 - y2):
		arr[1] = 1
	else:
		arr[1] = 2
print(*arr)


__author__ = 'Esfandiar and HajLorenzo'
a = list(map(int, input().split()))
res = 2
res -= a[0] == a[2]
res -= a[1] == a[3]
print(res, end=' ')
res = 2
black1 = (a[0] + a[1]) % 2 != 0
black2 = (a[2] + a[3]) % 2 != 0
if black1 != black2 or (a[0] == a[2] and a[1] == a[3]):
	print(0, end=' ')
else:
	print(1 if abs(a[0] - a[2]) == abs(a[1] - a[3]) else 2, end=' ')
print(abs(a[0] - a[2]) + max(abs(a[1] - a[3]) - abs(a[0] - a[2]), 0))


def main():
	(r1, c1, r2, c2) = map(int, input().split())
	print((r1 != r2) + (c1 != c2), 0 if r1 + r2 + c1 + c2 & 1 else 1 if abs(r1 - r2) == abs(c1 - c2) else 2, max(abs(r1 - r2), abs(c1 - c2)))
main()


pos = input()
c1 = int(pos.split()[0])
r1 = int(pos.split()[1])
c2 = int(pos.split()[2])
r2 = int(pos.split()[3])

def rook():
	if c1 == c2 or r1 == r2:
		return 1
	else:
		return 2

def bishop():
	if (c1 + r1) % 2 == (c2 + r2) % 2:
		if c1 - r1 == c2 - r2 or c1 + r1 == c2 + r2:
			return 1
		else:
			return 2
	else:
		return 0

def king():
	if r1 == r2:
		return abs(c2 - c1)
	elif c1 == c2:
		return abs(r2 - r1)
	elif abs(c2 - c1) >= abs(r2 - r1):
		return abs(c2 - c1)
	else:
		return abs(r2 - r1)
print(rook(), bishop(), king())


def imax(x, y):
	if x > y:
		return x
	else:
		return y
(r1, c1, r2, c2) = map(int, input().split())
rook = 0
bishop = 0
king = 0
if r1 == r2 or c1 == c2:
	rook = 1
else:
	rook = 2
x = r1 + c1
y = r2 + c2
j = r1 - c1
k = r2 - c2
if x == y or j == k:
	bishop = 1
elif (x + y) % 2 == 0:
	bishop = 2
else:
	bishop = 0
j = abs(r1 - r2)
k = abs(c1 - c2)
king = imax(j, k)
print(rook, bishop, king, sep=' ')


def isOdd(num):
	if num % 2 == 0:
		return False
	return True

def isBlackTile(tile):
	if isOdd(tile[0]) and isOdd(tile[1]) or (not isOdd(tile[0]) and (not isOdd(tile[1]))):
		return True
	return False

def main(inp):
	origin = [inp[0], inp[1]]
	destination = [inp[2], inp[3]]
	res = ''
	if origin == destination:
		res += '0 '
	if origin[0] == destination[0] or origin[1] == destination[1]:
		res += '1 '
	else:
		res += '2 '
	if origin == destination:
		res += '0 '
	elif abs(origin[0] - destination[0]) == abs(origin[1] - destination[1]):
		res += '1 '
	elif isBlackTile(origin) == isBlackTile(destination):
		res += '2 '
	else:
		res += '0 '
	diffX = abs(origin[0] - destination[0])
	diffY = abs(origin[1] - destination[1])
	res += str(max(diffX, diffY))
	return res

def test(testNum, inp, ans):
	print('Case ' + str(testNum) + '..........', end=' ')
	res = main(inp)
	assert res == ans, 'out: ' + str(res) + ' Should be: ' + str(ans)
	print('Success!')

def tdd():
	test(1, [4, 3, 1, 6], '2 1 3')
	test(2, [5, 5, 5, 6], '1 0 1')

def user():
	inp = list(map(int, input().split()))
	print(main(inp))
user()


def c(r1, c1, r2, c2):
	for x in range(-10, 10):
		if r2 - x == r1 and c2 - x == c1:
			return True
		if r2 - x == r1 and c2 + x == c1:
			return True
		if r2 + x == r1 and c2 - x == c1:
			return True
		if r2 - x == r1 and c2 - x == c1:
			return True
	return False

def main(r1, c1, r2, c2):
	r = min(1, abs(r2 - r1)) + min(1, abs(c2 - c1))
	b = 2
	if (r1 + c1) % 2 != (r2 + c2) % 2:
		b = 0
	if c(r1, c1, r2, c2):
		b = 1
	k = max(abs(r2 - r1), abs(c2 - c1))
	return '{} {} {}'.format(r, b, k)
print(main(*list(map(int, input().split(' ')))))


class CodeforcesTask370ASolution:

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

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

	def process_task(self):
		h = abs(self.cords[2] - self.cords[0])
		v = abs(self.cords[3] - self.cords[1])
		if self.cords[0] == self.cords[2] or self.cords[1] == self.cords[3]:
			rook = 1
		else:
			rook = 2
		if (self.cords[0] + self.cords[1]) % 2 != (self.cords[2] + self.cords[3]) % 2:
			bishop = 0
		elif h == v:
			bishop = 1
		else:
			bishop = 2
		king = max(h, v)
		self.result = '{0} {1} {2}'.format(rook, bishop, king)

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


c = list(map(int, input().split()))
a = [0, 0, 0]
if c[0] == c[2] or c[1] == c[3]:
	a[0] = 1
else:
	a[0] = 2
if (c[0] + c[1]) % 2 == (c[2] + c[3]) % 2:
	if abs(c[2] - c[0]) == abs(c[3] - c[1]):
		a[1] = 1
	else:
		a[1] = 2
a[2] = max(abs(c[2] - c[0]), abs(c[3] - c[1]))
print(*a)


a = list(map(int, input().split()))
rook = 2
if a[0] == a[2] or a[1] == a[3]:
	rook = 1
bishop = 0
if (a[0] + a[1]) % 2 == 0 and (a[2] + a[3]) % 2 == 0 or ((a[0] + a[1]) % 2 != 0 and (a[2] + a[3]) % 2 != 0):
	if a[0] + a[1] == a[2] + a[3] or abs(a[0] - a[2]) == abs(a[1] - a[3]):
		bishop = 1
	else:
		bishop = 2
king = max(abs(a[0] - a[2]), abs(a[1] - a[3]))
print(rook, end=' ')
print(bishop, end=' ')
print(king)


(a, b, c, d) = map(int, input().split())
if a == c and b == d:
	rook = 0
elif a == c or b == d:
	rook = 1
else:
	rook = 1 + 1
king = max(abs(a - c), abs(b - d))
if abs(a - c) % 2 != abs(b - d) % 2:
	bishop = 0
elif a == c and b == d:
	bishop = 0
elif abs(a - c) == abs(b - d):
	bishop = 1
else:
	bishop = 1 + 1
print(rook, bishop, king)


(x1, y1, x2, y2) = list(map(int, input().split()))
(a, b, c) = (0, 0, 0)
if x1 == x2 or y1 == y2:
	a = 1
else:
	a = 2
c = max(abs(x1 - x2), abs(y1 - y2))
if (abs(x1 - x2) + abs(y1 - y2)) % 2 != 0:
	b = 0
elif abs(x1 - x2) == abs(y1 - y2):
	b = 1
else:
	b = 2
print(a, b, c)


def rook(r1, c1, r2, c2):
	if r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def king(r1, c1, r2, c2):
	x = abs(c1 - c2)
	y = abs(r1 - r2)
	return max(x, y)

def bishop(r1, c1, r2, c2):
	if not (r1 + c1) % 2 == (r2 + c2) % 2:
		return 0
	x = abs(r1 - r2)
	y = abs(c1 - c2)
	if x == y:
		return 1
	return 2

def __starting_point():
	(r1, c1, r2, c2) = [int(x) for x in input().split()]
	r = rook(r1, c1, r2, c2)
	b = bishop(r1, c1, r2, c2)
	k = king(r1, c1, r2, c2)
	print(str(r) + ' ' + str(b) + ' ' + str(k))
__starting_point()


(r1, c1, r2, c2) = list(map(int, input().split()))
if r1 == r2 or c1 == c2:
	ladia = 1
	if r1 == r2:
		king = abs(c1 - c2)
	elif c1 == c2:
		king = abs(r1 - r2)
else:
	ladia = 2
	king = max(abs(r1 - r2), abs(c1 - c2))
if r1 % 2 == 1 and c1 % 2 == 1 or (r1 % 2 == 0 and c1 % 2 == 0):
	color1 = 'black'
else:
	color1 = 'white'
if r2 % 2 == 1 and c2 % 2 == 1 or (r2 % 2 == 0 and c2 % 2 == 0):
	color2 = 'black'
else:
	color2 = 'white'
if color1 == color2:
	if abs(r1 - r2) == abs(c1 - c2):
		slon = 1
	else:
		slon = 2
else:
	slon = 0
print(ladia, slon, king)


import math
(x1, y1, x2, y2) = map(int, input().split())
if x1 == x2 and y1 == y2:
	print(0, 0, 0)
else:
	if x1 == x2 or y1 == y2:
		l = 1
	else:
		l = 2
	if abs(x1 - x2) == abs(y1 - y2):
		s = 1
	elif (x1 + y1) % 2 == (x2 + y2) % 2:
		s = 2
	else:
		s = 0
	k = max(abs(x1 - x2), abs(y1 - y2))
	print(l, s, k)


def krod(x, y):
	if x == y:
		return 0
	else:
		return 1
abcd = input().split()
a = int(abcd[0])
b = int(abcd[1])
c = int(abcd[2])
d = int(abcd[3])
L = [0, 0, 0]
L[0] = krod(a, c) + krod(b, d)
L[2] = max(abs(a - c), abs(b - d))
if (a - b - c + d) % 2 == 0:
	if a + b == c + d or a - b == c - d:
		L[1] = 1
	else:
		L[1] = 2
print(*L)


(n, m, k, l) = input().split()
n = int(n)
m = int(m)
k = int(k)
l = int(l)
q = max(abs(n - k), abs(m - l))
if n == k and l == m:
	r = 0
elif n == k or l == m:
	r = 1
else:
	r = 2
if (n + m) % 2 != (k + l) % 2:
	b = 0
elif abs(n - k) == abs(m - l):
	b = 1
else:
	b = 2
print(r, b, q)


(r1, c1, r2, c2) = map(int, input().split())
r_dif = abs(r2 - r1)
c_dif = abs(c2 - c1)
print(0, 0, 0) if r_dif == 0 and c_dif == 0 else print(1 if r_dif == 0 or c_dif == 0 else 2, 0 if (r_dif + c_dif) % 2 == 1 else 1 if r_dif == c_dif else 2, max(r_dif, c_dif))


(x1, y1, x2, y2) = map(int, input().split())
if x1 == x2 or y1 == y2:
	print(1, end=' ')
else:
	print(2, end=' ')
if abs(x1 - x2) == abs(y1 - y2):
	print(1, end=' ')
elif abs(x1 - x2) % 2 != 0 and abs(y1 - y2) % 2 == 0 or (abs(x1 - x2) % 2 == 0 and abs(y1 - y2) % 2 != 0):
	print(0, end=' ')
else:
	print(2, end=' ')
print(max(abs(x1 - x2), abs(y1 - y2)))


read = lambda : map(int, input().split())
(r1, c1, r2, c2) = read()
L = 1 if r1 == r2 or c1 == c2 else 2
K = max(abs(r1 - r2), abs(c1 - c2))
if abs(r1 - r2) == abs(c1 - c2):
	S = 1
elif (r1 + c1) % 2 == (r2 + c2) % 2:
	S = 2
else:
	S = 0
print(L, S, K)


def stessocolore(x1, y1, x2, y2):
	if (x1 + y1) % 2 == (x2 + y2) % 2:
		return True
	else:
		return False
(x1, y1, x2, y2) = map(int, input().split())
if x1 == x2 or y1 == y2:
	rook = 1
else:
	rook = 2
king = max([abs(x1 - x2), abs(y1 - y2)])
if stessocolore(x1, y1, x2, y2):
	if x1 - y1 == x2 - y2 or x1 + y1 == x2 + y2:
		bish = 1
	else:
		bish = 2
else:
	bish = 0
print(rook, bish, king)


(a, b, c, d) = map(int, input().split())
if a == c or b == d:
	print('1', end=' ')
else:
	print('2', end=' ')
if abs(a - c) == abs(b - d):
	print('1', end=' ')
elif (a - b) % 2 == 0 and (c - d) % 2 == 0:
	print('2', end=' ')
elif (a - b) % 2 != 0 and (c - d) % 2 != 0:
	print('2', end=' ')
else:
	print('0', end=' ')
print(max(abs(a - c), abs(b - d)))


from itertools import accumulate as ac
from collections import Counter as cc
from bisect import bisect_left as bsl
from bisect import bisect as bs
from math import factorial as f
from collections import *
from itertools import *
from string import *
from bisect import *
from queue import *
from heapq import *
from math import *
from sys import *
from re import *

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
(x1, y1, x2, y2) = zzz()
king = max(abs(x1 - x2), abs(y1 - y2))
boat = 1 if x1 == x2 or y1 == y2 else 2
if (x1 + y1) % 2 != (x2 + y2) % 2:
	hati = 0
elif x1 - y1 == x2 - y2 or x1 + y1 == x2 + y2:
	hati = 1
else:
	hati = 2
print(boat, hati, king)


(r1, c1, r2, c2) = map(int, input().split())
a = 0
b = 0
c = max(abs(r2 - r1), abs(c2 - c1))
if r1 == r2 or c1 == c2:
	a = 1
else:
	a = 2
if r1 - c1 == r2 - c2 or r1 + c1 == r2 + c2:
	b = 1
elif (r1 + c1) % 2 != (r2 + c2) % 2:
	b = 0
else:
	b = 2
print(a, b, c)


(a, b, c, d) = map(int, input().split())
if a == c or b == d:
	q = 1
else:
	q = 2
if (a + b) % 2 == (c + d) % 2:
	if abs(c - a) == abs(b - d):
		w = 1
	else:
		w = 2
else:
	w = 0
e = max(abs(a - c), abs(b - d))
print(q, w, e)


def readln():
	return tuple(map(int, input().split()))
(r1, c1, r2, c2) = readln()
ans = [0, 0, 0]
if r1 == r2 or c1 == c2:
	ans[0] = 1
else:
	ans[0] = 2
if abs(r1 - r2) == abs(c1 - c2):
	ans[1] = 1
elif (abs(r1 - r2) % 2 == 0) == (abs(c1 - c2) % 2 == 0):
	ans[1] = 2
ans[2] = max(abs(r1 - r2), abs(c1 - c2))
print(*ans)


(x1, y1, x2, y2) = [int(i) for i in input().split()]
if x1 == x2 and y1 == y2:
	print(0, 0, 0)
else:
	if x1 == x2 or y1 == y2:
		print(1, end=' ')
	else:
		print(2, end=' ')
	color1 = x1 % 2 == 1 and y1 % 2 == 1 or (x1 % 2 == 0 and y1 % 2 == 0)
	color2 = x2 % 2 == 1 and y2 % 2 == 1 or (x2 % 2 == 0 and y2 % 2 == 0)
	if color1 != color2:
		print(0, end=' ')
	elif y1 - y2 != 0:
		if abs(x1 - x2) / abs(y1 - y2) == 1:
			print(1, end=' ')
		else:
			print(2, end=' ')
	else:
		print(2, end=' ')
	if y1 - y2 != 0:
		if abs(x1 - x2) / abs(y1 - y2) == 1:
			print(abs(x1 - x2))
		else:
			orib = min(abs(x1 - x2), abs(y1 - y2))
			saf = max(abs(x1 - x2), abs(y1 - y2)) - orib
			print(orib + saf)
	else:
		print(abs(x1 - x2))


(x1, y1, x2, y2) = map(int, input().split())

def lad(x1, y1, x2, y2):
	if x1 == x2 and y1 != y2 or (x1 != x2 and y1 == y2):
		print(1, end=' ')
	elif x1 != x2 and y1 != y2:
		print(2, end=' ')
	else:
		print(0, end=' ')

def slon(x1, y1, x2, y2):
	if abs(x1 - x2) == abs(y2 - y1):
		print(1, end=' ')
	elif abs(x1 - y1) % 2 != abs(x2 - y2) % 2:
		print(0, end=' ')
	else:
		print(2, end=' ')

def king(x1, y1, x2, y2):
	print(max(abs(x1 - x2), abs(y1 - y2)))
lad(x1, y1, x2, y2)
slon(x1, y1, x2, y2)
king(x1, y1, x2, y2)


import math
(r1, c1, r2, c2) = map(int, input().split(' '))
ans = []
if int(r1 == r2) ^ int(c1 == c2):
	ans.append(1)
elif r1 == r2 and c1 == c2:
	ans.append(0)
else:
	ans.append(2)
if abs(r1 - r2) == abs(c1 - c2):
	ans.append(1)
elif (r1 + c1) % 2 == 1 and (r2 + c2) % 2 == 1 or ((r1 + c1) % 2 == 0 and (r2 + c2) % 2 == 0):
	ans.append(2)
else:
	ans.append(0)
ans.append(max(abs(r2 - r1), abs(c2 - c1)))
print(*ans)


def rook(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		return 0
	if r1 == r2 or c1 == c2:
		return 1
	return 2

def bishop(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		return 0
	if abs(r1 - r2) == abs(c2 - c1):
		return 1
	if (r1 - r2 + c2 - c1) % 2 == 0:
		return 2
	return 0

def king(r1, c1, r2, c2):
	res1 = abs(r2 - r1)
	res2 = abs(c2 - c1)
	return max(res1, res2)
(r1, c1, r2, c2) = [int(x) for x in input().split()]
print(rook(r1, c1, r2, c2), bishop(r1, c1, r2, c2), king(r1, c1, r2, c2))


import math
A = list(map(int, input().split()))
r1 = A[0]
c1 = A[1]
r2 = A[2]
c2 = A[3]
if r1 == r2 or c1 == c2:
	if r1 == r2:
		king_movements = abs(c1 - c2)
	else:
		king_movements = abs(r1 - r2)
else:
	king_movements = max(abs(r1 - r2), abs(c1 - c2))
rook_movements = 1 if r1 == r2 or c1 == c2 else 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	bishop_movements = 0
elif c1 == -r1 + (c2 + r2) or c1 == r1 + (c2 - r2):
	bishop_movements = 1
else:
	bishop_movements = 2
print(rook_movements)
print(bishop_movements)
print(king_movements)


def rook(r1, c1, r2, c2):
	if r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def bishop(r1, c1, r2, c2):
	if (abs(r1 - r2) + abs(c1 - c2)) % 2 == 0:
		if abs(r1 - r2) == abs(c1 - c2):
			return 1
		else:
			return 2
	else:
		return 0

def king(r1, c1, r2, c2):
	return max(abs(r1 - r2), abs(c1 - c2))
(r1, c1, r2, c2) = map(int, input().split())
ans1 = rook(r1, c1, r2, c2)
ans2 = bishop(r1, c1, r2, c2)
ans3 = king(r1, c1, r2, c2)
print(ans1, ans2, ans3)


def move(r1, c1, r2, c2):
	if r2 == r1 or c2 == c1:
		l = 1
	else:
		l = 2
	k = max(abs(r2 - r1), abs(c2 - c1))
	if (r1 + c1) % 2 == (r2 + c2) % 2:
		if abs(r2 - r1) == abs(c2 - c1):
			s = 1
		else:
			s = 2
	else:
		s = 0
	return (l, k, s)
(r1, c1, r2, c2) = map(int, input().split())
(l, k, s) = move(r1, c1, r2, c2)
print(l, s, k)


(x0, y0, x1, y1) = map(int, input().split())
if x0 == x1:
	if y0 == y1:
		print(0, end=' ')
	else:
		print(1, end=' ')
elif y0 == y1:
	print(1, end=' ')
else:
	print(2, end=' ')
if (x0 + y0) % 2 != (x1 + y1) % 2:
	print(0, end=' ')
elif x0 == x1 and y0 == y1:
	print(0, end=' ')
elif abs(x0 - x1) == abs(y0 - y1):
	print(1, end=' ')
else:
	print(2, end=' ')
print(max(abs(x1 - x0), abs(y1 - y0)))


(r1, c1, r2, c2) = map(lambda x: int(x) - 1, input().split())

def solve_bishop(r1, c1, r2, c2):
	if abs(r1 - r2) == abs(c2 - c1):
		return 1
	elif (r1 + c1) % 2 == (r2 + c2) % 2:
		return 2
	else:
		return 0

def solve_king(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		return 0
	if r1 == r2:
		r_inc = 0
	else:
		r_inc = 1 if r2 > r1 else -1
	if c1 == c2:
		c_inc = 0
	else:
		c_inc = 1 if c2 > c1 else -1
	return 1 + solve_king(r1 + r_inc, c1 + c_inc, r2, c2)

def solve(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		return (0, 0, 0)
	if r1 != r2 and c1 != c2:
		rook = 2
	else:
		rook = 1
	bishop = solve_bishop(r1, c1, r2, c2)
	king = solve_king(r1, c1, r2, c2)
	return (rook, bishop, king)
print(*solve(r1, c1, r2, c2))


coordinates = list(map(int, input().strip().split()))
r1 = coordinates[0]
c1 = coordinates[1]
r2 = coordinates[2]
c2 = coordinates[3]
if (abs(r1 - r2) - abs(c1 - c2)) % 2 == 0:
	if abs(r1 - r2) == abs(c1 - c2):
		bishop = 1
	else:
		bishop = 2
else:
	bishop = 0
if r1 == r2 or c1 == c2:
	rook = 1
else:
	rook = 2
king = 0
if r1 - r2 == abs(c1 - c2):
	king = abs(r1 - r2)
else:
	while r1 != r2 and c1 != c2:
		if r2 > r1:
			r1 += 1
		elif r2 < r1:
			r1 -= 1
		if c2 > c1:
			c1 += 1
		elif c2 < c1:
			c1 -= 1
		king += 1
	if r1 == r2:
		king += abs(c1 - c2)
	elif c1 == c2:
		king += abs(r1 - r2)
print(rook, bishop, king)


(r1, c1, r2, c2) = input().split()
(r1, c1, r2, c2) = (int(r1), int(c1), int(r2), int(c2))
k = max(abs(r1 - r2), abs(c1 - c2))
if r1 == r2 or c1 == c2:
	r = 1
else:
	r = 2
if (r1 + c1) % 2 == 0 and (r2 + c2) % 2 != 0 or ((r1 + c1) % 2 != 0 and (r2 + c2) % 2 == 0):
	b = 0
elif abs(r2 - r1) == abs(c2 - c1):
	b = 1
else:
	b = 2
print(str(r) + ' ' + str(b) + ' ' + str(k))


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
(r1, c1, r2, c2) = mi()
ans = []
if r1 == r2 or c1 == c2:
	ans.append(1)
else:
	ans.append(2)
if (abs(r1 - r2) + abs(c1 - c2)) % 2 != 0:
	ans.append(0)
elif r1 - r2 == c1 - c2 or r1 - r2 == c2 - c1:
	ans.append(1)
else:
	ans.append(2)
ans.append(max(abs(r1 - r2), abs(c1 - c2)))
print(wr(ans))


(r1, c1, r2, c2) = map(int, input().split())
l = []
if r1 == r2 or c1 == c2:
	l.append(1)
else:
	l.append(2)
if not (r1 + c1) % 2 == (r2 + c2) % 2:
	l.append(0)
elif r1 - r2 == c1 - c2 or r1 + c1 == r2 + c2:
	l.append(1)
else:
	l.append(2)
l.append(max(abs(r1 - r2), abs(c1 - c2)))
print(*l)


l = list(map(int, input().split()))
x = l[0]
y = l[1]
a = l[2]
b = l[3]
if x == a or y == b:
	print('1', end=' ')
else:
	print('2', end=' ')
if (x + y) % 2 != (a + b) % 2:
	print('0', end=' ')
elif abs(x - a) == abs(y - b):
	print('1', end=' ')
else:
	print('2', end=' ')
print(max(abs(x - a), abs(y - b)))


(r1, c1, r2, c2) = map(int, input().split())

def rookMoves():
	return 1 if r1 == r2 or c1 == c2 else 2

def bishopMoves():
	if (r1 + c1) % 2 != (r2 + c2) % 2:
		return 0
	if r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
		return 1
	return 2

def kingMoves():
	return max(abs(r1 - r2), abs(c1 - c2))
print(rookMoves(), bishopMoves(), kingMoves())


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline())
is1 = lambda : stdin.readline()
iia = lambda : map(int, stdin.readline().split())
isa = lambda : stdin.readline().split()
(r1, c1, r2, c2) = iia()
ele = None
if r1 == r2 or c1 == c2:
	ele = 1
else:
	ele = 2
king = None
if r1 == r2:
	king = abs(c2 - c1)
elif c1 == c2:
	king = abs(r2 - r1)
elif abs(r2 - r1) == abs(c2 - c1):
	king = abs(r2 - r1)
else:
	king = max(abs(r2 - r1), abs(c2 - c1))
bishop = None
if r1 == r2:
	if abs(c2 - c1) % 2 == 0:
		bishop = 2
	else:
		bishop = 0
elif c1 == c2:
	if abs(r2 - r1) % 2 == 0:
		bishop = 2
	else:
		bishop = 0
elif abs(r2 - r1) == abs(c2 - c1):
	bishop = 1
elif (r1 + c1) % 2 != (r2 + c2) % 2:
	bishop = 0
else:
	bishop = 2
print(ele, bishop, king)


(r1, c1, r2, c2) = map(int, input().split())
rook = 1
if r1 != r2 and c1 != c2:
	rook += 1
if not (r1 + c1) % 2 == (r2 + c2) % 2:
	bis = 0
elif abs(r1 - r2) == abs(c1 - c2):
	bis = 1
else:
	bis = 2
king = abs(r1 - r2) + abs(c1 - c2) - min(abs(r1 - r2), abs(c1 - c2))
print(f'{rook} {bis} {king}')


(r1, c1, r2, c2) = [int(x) for x in input().split()]
if r1 == r2 or c1 == c2:
	if r1 == r2 and c1 % 2 != c2 % 2 or (c1 == c2 and r1 % 2 != r2 % 2):
		print(1, 0, abs(r1 - r2) + abs(c1 - c2))
	else:
		print(1, 2, abs(r1 - r2) + abs(c1 - c2))
elif abs(r1 - r2) == abs(c1 - c2):
	print(2, 1, abs(r1 - r2))
elif (r1 + c1) % 2 == (r2 + c2) % 2:
	print(2, 2, max(abs(r1 - r2), abs(c1 - c2)))
else:
	print(2, 0, max(abs(r1 - r2), abs(c1 - c2)))


from math import *
s = []
cpt = 0
(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2:
	s += [1]
	if (c2 - c1) % 2 != 0:
		s += [0]
	else:
		s += [2]
	s += [abs(c1 - c2)]
elif r1 != r2:
	cpt = abs(r1 - r2) + abs(c2 - c1)
	if c1 == c2:
		s += [1]
	else:
		s += [2]
	if abs(r1 - r2) == abs(c1 - c2):
		s += [1]
	elif cpt % 2 != 0:
		s += [0]
	else:
		s += [2]
	if abs(r1 - r2) == abs(c1 - c2):
		s += [abs(r1 - r2)]
	elif abs(r1 - r2) < abs(c1 - c2):
		s += [abs(abs(c1 - c2))]
	else:
		s += [abs(abs(r1 - r2))]
print(*s)


a = input().split(' ')
(x1, y1, x2, y2) = (int(a[0]), int(a[1]), int(a[2]), int(a[3]))

def rook(x1, y1, x2, y2):
	moves = 0
	if x1 - x2 != 0:
		moves += 1
	if y1 - y2 != 0:
		moves += 1
	return moves

def bishop(x1, y1, x2, y2):
	moves = 0
	if abs(x1 - x2) == abs(y1 - y2):
		moves = 1
	elif (x1 + y1) % 2 == (x2 + y2) % 2:
		moves = 2
	return moves

def king(x1, y1, x2, y2):
	(moves1, moves2) = (0, 60)
	move = abs(x1 - x2) + abs(y1 - y2)
	if abs(x1 - x2) == abs(y1 - y2):
		moves1 = abs(x1 - x2)
	elif abs(x1 - x2) > abs(y1 - y2):
		x1 = x1 - abs(y1 - y2)
		moves1 = abs(y1 - y2) + abs(x2 - x1)
		x1 = x1 + 2 * abs(y1 - y2)
		moves2 = abs(y1 - y2) + abs(x2 - x1)
	else:
		y1 = y1 - abs(x1 - x2)
		moves1 = abs(x1 - x2) + abs(y1 - y2)
		y1 = y1 + 2 * abs(x1 - x2)
		moves2 = abs(x1 - x2) + abs(y1 - y2)
	return min(move, moves1, moves2)
print(rook(x1, y1, x2, y2), bishop(x1, y1, x2, y2), king(x1, y1, x2, y2))


def rook(sx, sy, lx, ly):
	if sx != lx or sy != ly:
		if sx == lx:
			move = 1
		elif sy == ly:
			move = 1
		else:
			move = 2
	else:
		move = 0
	return move

def bishop(sx, sy, lx, ly):
	if sx != lx or sy != ly:
		if (sx + sy) % 2 != (lx + ly) % 2:
			move = 0
		elif sx + sy == lx + ly or abs(sx - lx) == abs(sy - ly):
			move = 1
		else:
			move = 2
	else:
		move = 0
	return move

def king(sx, sy, lx, ly):
	move = 0
	if sx == lx:
		move = abs(sy - ly)
	elif sy == ly:
		move = abs(sx - lx)
	else:
		while sx != lx or sy != ly:
			if sx > lx:
				sx -= 1
			elif sx < lx:
				sx += 1
			if sy > ly:
				sy -= 1
			elif sy < ly:
				sy += 1
			move += 1
	return move

def main():
	(p1, p2, p3, p4) = map(int, input().split())
	move = []
	move.append(rook(p1, p2, p3, p4))
	move.append(bishop(p1, p2, p3, p4))
	move.append(king(p1, p2, p3, p4))
	for x in move:
		print(x, end=' ')
main()


import math
(x1, y1, x2, y2) = tuple((int(i) for i in input().split()))
V = [[0 for j in range(10)] for i in range(10)]

def black(x, y):
	if x % 2 == 1:
		return y % 2 == 1
	else:
		return y % 2 == 0
a = 2
b = 0
c = 0
if x1 == x2:
	a -= 1
if y1 == y2:
	a -= 1
if abs(x1 - x2) == abs(y1 - y2):
	b = 1
elif black(x1, y1) == black(x2, y2):
	b = 2
else:
	b = 0
c = max(abs(x1 - x2), abs(y1 - y2))
print(a, b, c)


import sys
(x1, y1, x2, y2) = map(int, input().split())
if x1 == x2 or y1 == y2:
	sys.stdout.write('1 ')
else:
	sys.stdout.write('2 ')
if (x1 - x2) % 2 == 0 and y1 % 2 != y2 % 2 or ((x1 - x2) % 2 != 0 and y1 % 2 == y2 % 2):
	sys.stdout.write('0 ')
elif x1 == x2:
	if y1 % 2 == y2 % 2:
		sys.stdout.write('2 ')
	else:
		sys.stdout.write('0 ')
elif y1 == y2:
	if x1 % 2 == x2 % 2:
		sys.stdout.write('2 ')
	else:
		sys.stdout.write('0 ')
elif abs((y1 - y2) / (x1 - x2)) == 1.0:
	sys.stdout.write('1 ')
else:
	sys.stdout.write('2 ')
if abs(x1 - x2) > abs(y1 - y2):
	print(abs(x1 - x2))
else:
	print(abs(y1 - y2))


co = input()
co = co.split()
r1 = int(co[0])
c1 = int(co[1])
r2 = int(co[2])
c2 = int(co[3])
result = [0, 0, 0]
if c1 - c2 != 0:
	result[0] += 1
if r1 - r2 != 0:
	result[0] += 1
if (c1 + r1) % 2 == (c2 + r2) % 2:
	if abs(c1 - c2) == abs(r1 - r2):
		result[1] = 1
	else:
		result[1] = 2
if abs(c1 - c2) > abs(r1 - r2):
	result[2] = abs(c1 - c2)
else:
	result[2] = abs(r1 - r2)
result[0] = str(result[0])
result[1] = str(result[1])
result[2] = str(result[2])
print(' '.join(result))


import sys
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
ni = lambda : int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda : list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda : float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda : list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda : stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda : stdin.readline().split()
from collections import deque
(x, y, gx, gy) = na()
x -= 1
y -= 1
gx -= 1
gy -= 1
(h, w) = (8, 8)

def bfs(ty):
	q = deque()
	q.append((x, y))
	dist = [[inf] * w for _ in range(h)]
	dist[y][x] = 0
	while len(q):
		p = q.popleft()
		(cx, cy) = p
		if ty == 'rook':
			dx = [0, 1, -1, 0]
			dy = [1, 0, 0, -1]
			for i in range(4):
				(nx, ny) = (cx + dx[i], cy + dy[i])
				while nx >= 0 and nx < w and (ny >= 0) and (ny < h):
					if dist[ny][nx] == inf:
						dist[ny][nx] = dist[cy][cx] + 1
						q.append((nx, ny))
					(nx, ny) = (nx + dx[i], ny + dy[i])
		elif ty == 'bishop':
			dx = [1, -1, -1, 1]
			dy = [-1, 1, -1, 1]
			for i in range(4):
				(nx, ny) = (cx + dx[i], cy + dy[i])
				while nx >= 0 and nx < w and (ny >= 0) and (ny < h):
					if dist[ny][nx] == inf:
						dist[ny][nx] = dist[cy][cx] + 1
						q.append((nx, ny))
					(nx, ny) = (nx + dx[i], ny + dy[i])
		elif ty == 'king':
			dx = [1, 1, 1, 0, -1, -1, -1, 0]
			dy = [1, 0, -1, -1, -1, 0, 1, 1]
			for i in range(8):
				(nx, ny) = (cx + dx[i], cy + dy[i])
				if nx >= 0 and nx < w and (ny >= 0) and (ny < h) and (dist[ny][nx] == inf):
					dist[ny][nx] = dist[cy][cx] + 1
					q.append((nx, ny))
	return dist[gy][gx] if dist[gy][gx] != inf else 0
print(bfs('rook'), bfs('bishop'), bfs('king'))


def rook(r1, c1, r2, c2):
	if r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def bishop(r1, c1, r2, c2):
	s1 = r1 + c1
	s2 = r2 + c2
	if s1 % 2 == 0 and s2 % 2 != 0 or (s1 % 2 != 0 and s2 % 2 == 0):
		return 0
	elif abs(r1 - r2) == abs(c1 - c2):
		return 1
	else:
		return 2

def king(r1, c1, r2, c2):
	mine = abs(r1 - r2) + abs(c1 - c2)
	for i in range(1, 9):
		if abs(i - r2) == abs(c1 - c2):
			mine = min(mine, abs(i - r1) + abs(c1 - c2))
	for i in range(1, 9):
		if abs(i - c2) == abs(r1 - r2):
			mine = min(mine, abs(i - c1) + abs(r2 - r1))
	return mine
s = input().split()
r1 = int(s[0])
c1 = int(s[1])
r2 = int(s[2])
c2 = int(s[3])
ans = str(rook(r1, c1, r2, c2)) + ' ' + str(bishop(r1, c1, r2, c2)) + ' ' + str(king(r1, c1, r2, c2))
print(ans)


def checkit(x1, y1, x2, y2):
	check = [[0 for i in range(8)] for j in range(8)]
	for i in range(1, 9):
		if i % 2 == 0:
			for j in range(1, 9):
				if j % 2 == 0:
					check[i - 1][j - 1] = 1
		else:
			for j in range(1, 9):
				if j % 2 != 0:
					check[i - 1][j - 1] = 1
	if check[x1 - 1][y1 - 1] == check[x2 - 1][y2 - 1]:
		return True
	else:
		return False

def bishop_tell(x1, y1, x2, y2):
	bishop = 0
	if not checkit(x1, y1, x2, y2):
		return 0
	else:
		if y1 > y2:
			(x1, x2) = (x2, x1)
			(y1, y2) = (y2, y1)
		if x2 > x1:
			while x1 < 9 and y1 < 9:
				x1 += 1
				y1 += 1
				if x1 == x2 and y1 == y2:
					return 1
					break
		if x1 > x2:
			while x1 > 0 and y1 < 9:
				x1 -= 1
				y1 += 1
				if x1 == x2 and y1 == y2:
					return 1
					break
		return 2
(x1, y1, x2, y2) = map(int, input().split())
rook = 0
bishop = bishop_tell(x1, y1, x2, y2)
king = 0
if x1 == x2 or y1 == y2:
	king = abs(x1 - x2) + abs(y1 - y2)
	rook = 1
else:
	rook = 2
	steps = 0
	if y1 > y2:
		(x1, x2) = (x2, x1)
		(y1, y2) = (y2, y1)
	if x2 > x1:
		while x1 < 9 and y1 < 9:
			x1 += 1
			y1 += 1
			steps += 1
			if x1 == x2 or y1 == y2:
				break
		if x1 == x2 or y1 == y2:
			steps += abs(x1 - x2) + abs(y1 - y2)
	else:
		while x1 > 0 and y1 < 9:
			x1 -= 1
			y1 += 1
			steps += 1
			if x1 == x2 or y1 == y2:
				break
		if x1 == x2 or y1 == y2:
			steps += abs(x1 - x2) + abs(y1 - y2)
	king = steps
print(rook, bishop, king)


a = list(map(int, input().split()))
y1 = a[0]
d1 = a[1]
y2 = a[2]
d2 = a[3]
yatay = abs(y1 - y2)
dikey = abs(d1 - d2)
a = [0, 0, 0]
if yatay == 0 or dikey == 0:
	a[0] = 1
else:
	a[0] = 2
if (y1 + d1) % 2 == (y2 + d2) % 2:
	if yatay == dikey:
		a[1] = 1
	else:
		a[1] = 2
else:
	a[1] = 0
if yatay == dikey:
	a[2] = yatay
else:
	a[2] = abs(yatay - dikey) + min(yatay, dikey)
print(*a)


import math
A = list(map(int, input().split()))
r1 = A[0]
c1 = A[1]
r2 = A[2]
c2 = A[3]
if r1 == r2 or c1 == c2:
	if r1 == r2:
		mi_rey = abs(c1 - c2)
	else:
		mi_rey = abs(r1 - r2)
else:
	mi_rey = max(abs(r1 - r2), abs(c1 - c2))
mi_torre = 1 if r1 == r2 or c1 == c2 else 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	mi_alfil = 0
elif c1 == -r1 + (c2 + r2) or c1 == r1 + (c2 - r2):
	mi_alfil = 1
else:
	mi_alfil = 2
print(mi_torre)
print(mi_alfil)
print(mi_rey)


from collections import deque
(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2 or c1 == c2:
	n1 = 1
else:
	n1 = 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	n2 = 0
elif r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
	n2 = 1
else:
	n2 = 2
(r_min, r_max, c_min, c_max) = (min(r1, r2), max(r1, r2), min(c1, c2), max(c1, c2))
chess = [[0] * 9 for i in range(9)]
q = deque([(r1, c1)])
n3 = 0
while q:
	q2 = deque()
	while q:
		(r, c) = q.popleft()
		if (r, c) == (r2, c2):
			break
		chess[r][c] = 1
		if r - 1 >= r_min and c - 1 >= c_min and (not chess[r - 1][c - 1]):
			q2.append((r - 1, c - 1))
		if r - 1 >= r_min and (not chess[r - 1][c]):
			q2.append((r - 1, c))
		if r - 1 >= r_min and c + 1 <= c_max and (not chess[r - 1][c + 1]):
			q2.append((r - 1, c + 1))
		if c - 1 >= c_min and (not chess[r][c - 1]):
			q2.append((r, c - 1))
		if c + 1 <= c_max and (not chess[r][c + 1]):
			q2.append((r, c + 1))
		if r + 1 <= r_max and c - 1 >= c_min and (not chess[r + 1][c - 1]):
			q2.append((r + 1, c - 1))
		if r + 1 <= r_max and (not chess[r + 1][c]):
			q2.append((r + 1, c))
		if r + 1 <= r_max and c + 1 <= c_max and (not chess[r + 1][c + 1]):
			q2.append((r + 1, c + 1))
	else:
		q = q2
		n3 += 1
		continue
	break
print(n1, n2, n3)


from collections import deque

def rook_bishop_and_king(r1_int, c1_int, r2_int, c2_int) -> tuple:
	if r1_int == r2_int or c1_int == c2_int:
		rook_move = 1
	else:
		rook_move = 2
	bishop_move = 0
	r1_c1_reach = set()
	(r_curr, c_curr) = (r1 + 1, c1 + 1)
	while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
		r1_c1_reach.add((r_curr, c_curr))
		(r_curr, c_curr) = (r_curr + 1, c_curr + 1)
	(r_curr, c_curr) = (r1 + 1, c1 - 1)
	while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
		r1_c1_reach.add((r_curr, c_curr))
		(r_curr, c_curr) = (r_curr + 1, c_curr - 1)
	(r_curr, c_curr) = (r1 - 1, c1 + 1)
	while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
		r1_c1_reach.add((r_curr, c_curr))
		(r_curr, c_curr) = (r_curr - 1, c_curr + 1)
	(r_curr, c_curr) = (r1 - 1, c1 - 1)
	while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
		r1_c1_reach.add((r_curr, c_curr))
		(r_curr, c_curr) = (r_curr - 1, c_curr - 1)
	if (r2, c2) in r1_c1_reach:
		bishop_move = 1
	if bishop_move == 0:
		r2_c2_reach = set()
		(r_curr, c_curr) = (r2 + 1, c2 + 1)
		while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
			r2_c2_reach.add((r_curr, c_curr))
			(r_curr, c_curr) = (r_curr + 1, c_curr + 1)
		(r_curr, c_curr) = (r2 + 1, c2 - 1)
		while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
			r2_c2_reach.add((r_curr, c_curr))
			(r_curr, c_curr) = (r_curr + 1, c_curr - 1)
		(r_curr, c_curr) = (r2 - 1, c2 + 1)
		while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
			r2_c2_reach.add((r_curr, c_curr))
			(r_curr, c_curr) = (r_curr - 1, c_curr + 1)
		(r_curr, c_curr) = (r2 - 1, c2 - 1)
		while 1 <= r_curr <= 8 and 1 <= c_curr <= 8:
			r2_c2_reach.add((r_curr, c_curr))
			(r_curr, c_curr) = (r_curr - 1, c_curr - 1)
		for each in r2_c2_reach:
			if each in r1_c1_reach:
				bishop_move = 2
				break
	king_r1_c1_reach = deque()
	visited = set()
	king_r1_c1_reach.append((r1, c1))
	parent = dict()
	found = False
	while len(king_r1_c1_reach) > 0:
		(r_curr, c_curr) = king_r1_c1_reach.popleft()
		if (r_curr, c_curr) == (r2, c2):
			found = True
			break
		if 1 <= c_curr + 1 <= 8:
			if (r_curr, c_curr + 1) not in visited:
				king_r1_c1_reach.append((r_curr, c_curr + 1))
				parent[r_curr, c_curr + 1] = (r_curr, c_curr)
				visited.add((r_curr, c_curr + 1))
		if 1 <= r_curr + 1 <= 8 and 1 <= c_curr + 1 <= 8:
			if (r_curr + 1, c_curr + 1) not in visited:
				king_r1_c1_reach.append((r_curr + 1, c_curr + 1))
				parent[r_curr + 1, c_curr + 1] = (r_curr, c_curr)
				visited.add((r_curr + 1, c_curr + 1))
		if 1 <= r_curr + 1 <= 8:
			if (r_curr + 1, c_curr) not in visited:
				king_r1_c1_reach.append((r_curr + 1, c_curr))
				parent[r_curr + 1, c_curr] = (r_curr, c_curr)
				visited.add((r_curr + 1, c_curr))
		if 1 <= r_curr + 1 <= 8 and 1 <= c_curr - 1 <= 8:
			if (r_curr + 1, c_curr - 1) not in visited:
				king_r1_c1_reach.append((r_curr + 1, c_curr - 1))
				parent[r_curr + 1, c_curr - 1] = (r_curr, c_curr)
				visited.add((r_curr + 1, c_curr - 1))
		if 1 <= c_curr - 1 <= 8:
			if (r_curr, c_curr - 1) not in visited:
				king_r1_c1_reach.append((r_curr, c_curr - 1))
				parent[r_curr, c_curr - 1] = (r_curr, c_curr)
				visited.add((r_curr, c_curr - 1))
		if 1 <= r_curr - 1 <= 8 and 1 <= c_curr - 1 <= 8:
			if (r_curr - 1, c_curr - 1) not in visited:
				king_r1_c1_reach.append((r_curr - 1, c_curr - 1))
				parent[r_curr - 1, c_curr - 1] = (r_curr, c_curr)
				visited.add((r_curr - 1, c_curr - 1))
		if 1 <= r_curr - 1 <= 8:
			if (r_curr - 1, c_curr) not in visited:
				king_r1_c1_reach.append((r_curr - 1, c_curr))
				parent[r_curr - 1, c_curr] = (r_curr, c_curr)
				visited.add((r_curr - 1, c_curr))
		if 1 <= r_curr - 1 <= 8 and 1 <= c_curr + 1 <= 8:
			if (r_curr - 1, c_curr + 1) not in visited:
				king_r1_c1_reach.append((r_curr - 1, c_curr + 1))
				parent[r_curr - 1, c_curr + 1] = (r_curr, c_curr)
				visited.add((r_curr - 1, c_curr + 1))
	if not found:
		king_move = 0
	else:
		(r_curr, c_curr) = (r2, c2)
		king_move = 0
		while True:
			if (r_curr, c_curr) == (r1, c1):
				break
			else:
				(r_curr, c_curr) = parent[r_curr, c_curr]
				king_move += 1
	return (rook_move, bishop_move, king_move)
(r1, c1, r2, c2) = list(map(int, input().split()))
print(*rook_bishop_and_king(r1, c1, r2, c2))


(x_now, y_now, aim_x, aim_y) = map(int, input().split())
ans = []
if x_now == aim_x or y_now == aim_y:
	ans.append('1')
else:
	ans.append('2')
if (x_now + y_now) % 2 == (aim_x + aim_y) % 2:
	if abs(x_now - aim_x) == abs(y_now - aim_y):
		ans.append('1')
	else:
		ans.append('2')
else:
	ans.append('0')
ans.append(str(max(abs(aim_x - x_now), abs(aim_y - y_now))))
print(' '.join(ans))


b = input().split()
x = int(b[0])
y = int(b[1])
x2 = int(b[2])
y2 = int(b[3])
if x == x2 or y == y2:
	print(1, end=' ')
else:
	print(2, end=' ')
if x == x2:
	if (max(y, y2) - min(y, y2)) % 2 == 0:
		print(2, end=' ')
	else:
		print(0, end=' ')
elif y == y2:
	if (max(x, x2) - min(x, x2)) % 2 == 0:
		print(2, end=' ')
	else:
		print(0, end=' ')
elif max(x, x2) - min(x, x2) == max(y, y2) - min(y, y2):
	print(1, end=' ')
elif (max(y, y2) - min(y, y2)) % 2 == 0 and (max(x, x2) - min(x, x2)) % 2 == 1 or ((max(y, y2) - min(y, y2)) % 2 == 1 and (max(x, x2) - min(x, x2)) % 2 == 0):
	print(0, end=' ')
else:
	print(2, end=' ')
if x == x2:
	print(max(y, y2) - min(y, y2))
elif y == y2:
	print(max(x, x2) - min(x, x2))
elif max(x, x2) - min(x, x2) == max(y, y2) - min(y, y2):
	print(max(x, x2) - min(x, x2))
else:
	print(max(max(x, x2) - min(x, x2), max(y, y2) - min(y, y2)))


R = lambda : map(int, input().split())
(x1, y1, x2, y2) = R()
if x1 == x2 or y1 == y2:
	print(1, end=' ')
else:
	print(2, end=' ')
if (x1 + y1) % 2 == (x2 + y2) % 2:
	if abs(x1 - x2) == abs(y1 - y2):
		print(1, end=' ')
	else:
		print(2, end=' ')
else:
	print(0, end=' ')
print(max(abs(x1 - x2), abs(y1 - y2)))


(x1, y1, x2, y2) = map(int, input().split())
n = 8

def check(x):
	return 1 <= x <= n

def get_nbs_sl(x, y):
	for i in range(-8, 9):
		(a, b) = (x + i, y + i)
		(c, d) = (x - i, y + i)
		if i == 0:
			continue
		if check(a) and check(b):
			yield (a, b)
		if check(c) and check(d):
			yield (c, d)

def get_nbs_ld(x, y):
	for i in range(1, n + 1):
		if i != x:
			yield (i, y)
	for i in range(1, n + 1):
		if i != y:
			yield (x, i)

def get_nbs_king(x, y):
	for i in range(-1, 2):
		for j in range(-1, 2):
			(nx, ny) = (x + i, y + j)
			if (nx, ny) != (x, y) and check(nx) and check(ny):
				yield (nx, ny)

def bfs(start_x, start_y, fin_x, fin_y, get_nbs):
	dist = {(start_x, start_y): 0}
	q = [(start_x, start_y)]
	while q:
		v = q.pop(0)
		for u in get_nbs(v[0], v[1]):
			if u not in dist:
				dist[u] = dist[v] + 1
				q.append(u)
	if (fin_x, fin_y) in dist:
		return dist[fin_x, fin_y]
	else:
		return 0
ld = bfs(x1, y1, x2, y2, get_nbs_ld)
sl = bfs(x1, y1, x2, y2, get_nbs_sl)
kk = bfs(x1, y1, x2, y2, get_nbs_king)
print(ld, sl, kk)


(a, b, c, d) = map(int, input().split())
s = str(int(a != c) + int(b != d)) + ' '
if (a + b) % 2 != (c + d) % 2:
	s += '0 '
elif a + b == c + d or a - b == c - d:
	s += '1 '
else:
	s += '2 '
s += str(max(abs(a - c), abs(b - d)))
print(s)


(r_1, c_1, r_2, c_2) = map(int, input().split())
if r_1 == r_2 or c_1 == c_2:
	rook = 1
else:
	rook = 2
if abs(r_1 - r_2) == abs(c_1 - c_2):
	bishop = 1
elif (r_1 + c_1) % 2 != (r_2 + c_2) % 2:
	bishop = 0
else:
	bishop = 2
king = max(abs(r_1 - r_2), abs(c_1 - c_2))
print(' '.join(map(str, [rook, bishop, king])))


(a, b, c, d) = map(int, input().split())
a = abs(a - c)
b = abs(b - d)
x = min(a, 1) + min(b, 1)
y = max(a, b)
z = 2
if a == b:
	z = 1
if a + b == 0 or (a + b) % 2:
	z = 0
print(x, z, y)


(x, y, x1, y1) = map(int, input().split())
(a, b, c) = (0, 0, 0)

def ladya(x, y, x1, y1):
	global a
	if x == x1 or y == y1:
		a = 1
	else:
		a = 2

def slon(x, y, x1, y1):
	global b
	if (x + y) % 2 == (x1 + y1) % 2:
		b = 2
		if abs(x - x1) == abs(y - y1):
			b = 1

def king(x, y, x1, y1):
	global c
	if abs(x - x1) > abs(y - y1):
		c = abs(x - x1)
	else:
		c = abs(y - y1)
ladya(x, y, x1, y1)
slon(x, y, x1, y1)
king(x, y, x1, y1)
print(a, b, c)


import sys
line = sys.stdin.readline().split()
(r1, c1, r2, c2) = (int(line[0]), int(line[1]), int(line[2]), int(line[3]))
(rook, bishop, king) = (0, 0, 0)
if r1 != r2 and c1 != c2:
	rook = 2
else:
	rook = 1
if abs(r1 - r2) == abs(c1 - c2):
	bishop = 1
elif abs(r1 - r2) % 2 == abs(c1 - c2) % 2:
	bishop = 2
else:
	bishop = 0
king = max(abs(r1 - r2), abs(c1 - c2))
print(rook, bishop, king)


(r1, c1, r2, c2) = map(int, input().split())
if r2 != r1 and c1 != c2:
	print(2, end=' ')
else:
	print(1, end=' ')
MoveInOne = False
for inx in [-1, 1]:
	for iny in [-1, 1]:
		x = r1
		y = c1
		while x > 0 and y > 0 and (x <= 8) and (y <= 8):
			if x == r2 and y == c2:
				MoveInOne = True
				break
			x += inx
			y += iny
if (r1 + c1) % 2 != (r2 + c2) % 2:
	print(0, end=' ')
elif MoveInOne:
	print(1, end=' ')
else:
	print(2, end=' ')
x = abs(r2 - r1)
y = abs(c2 - c1)
print(max(x, y))


(r1, c1, r2, c2) = map(int, input().split())
ans = [0, 0, 0]
import sys
if r1 == r2 or c1 == c2:
	if r1 == r2 and c1 == c2:
		print(0, 0, 0)
		sys.exit()
	else:
		ans[0] = 1
else:
	ans[0] = 2
ans[2] = max(abs(r1 - r2), abs(c1 - c2))
if (r1 + c1) % 2 ^ (r2 + c2) % 2 == 1:
	ans[1] = 0
	print(' '.join((str(x) for x in ans)))
else:
	if r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
		ans[1] = 1
	else:
		ans[1] = 2
	print(' '.join((str(x) for x in ans)))


import sys
input = sys.stdin.readline

def read():
	return tuple(map(int, input().split()))

def rookMoves(init, dest):
	if init[0] == dest[0]:
		return 1
	if init[1] == dest[1]:
		return 1
	return 2

def bishopMoves(init, dest):
	if (init[0] + init[1]) % 2 != (dest[0] + dest[1]) % 2:
		return 0
	if abs(dest[0] - init[0]) != abs(dest[1] - init[1]):
		return 2
	return 1

def kingMoves(init, dest):
	return max(abs(dest[0] - init[0]), abs(dest[1] - init[1]))
(ri, ci, rf, cf) = read()
if ri == rf and ci == cf:
	print('0 0 0')
else:
	print('{0} {1} {2}'.format(rookMoves((ri, ci), (rf, cf)), bishopMoves((ri, ci), (rf, cf)), kingMoves((ri, ci), (rf, cf))))


(r1, c1, r2, c2) = map(int, input().split())
rook = 0
biop = 0
king = 0
if r1 == r2 and c1 == c2:
	print('0 0 0')
else:
	if r1 == r2 or c1 == c2:
		rook = 1
	else:
		rook = 2
	k1 = (r1 + c1) % 2
	k2 = (r2 + c2) % 2
	d1 = abs(r1 - r2)
	d2 = abs(c1 - c2)
	if k1 == k2:
		if d1 == d2:
			biop = 1
		else:
			biop = 2
	king = max(d1, d2)
	print(str(rook) + ' ' + str(biop) + ' ' + str(king))


(m, n, o, p) = map(int, input().split())

def gKing(m, n, o, p):
	return str(max(abs(o - m), abs(p - n)))

def gRook(m, n, o, p):
	return str((0 if m == o else 1) + (0 if n == p else 1))

def gBishop(m, n, o, p):
	return str(0 if (m + n) % 2 != (o + p) % 2 or (m == o and n == p) else 1 if m + n == o + p or m - n == o - p else 2)
print(gRook(m, n, o, p) + ' ' + gBishop(m, n, o, p) + ' ' + gKing(m, n, o, p))


import math
(r1, c1, r2, c2) = input().split()
r1 = int(r1)
c1 = int(c1)
r2 = int(r2)
c2 = int(c2)
l = []
if math.fabs(r1 - r2) == 0 or math.fabs(c1 - c2) == 0:
	l.append(1)
else:
	l.append(2)
if math.fabs(r1 - r2) == math.fabs(c1 - c2):
	l.append(1)
elif (r1 + c1) % 2 == (r2 + c2) % 2:
	l.append(2)
else:
	l.append(0)
l.append(int(max(math.fabs(r1 - r2), math.fabs(c1 - c2))))
for i in l:
	print(i, end=' ')


(r1, c1, r2, c2) = list(map(int, input().split(' ')))
(x, y) = (abs(r1 - r2), abs(c1 - c2))
initial = 0
if x == 0 and y == 0:
	print(0, 0, 0)
else:
	king = min(x, y)
	kmoves = king + abs(x - y)
	if x == 0 or y == 0:
		rmoves = 1
	else:
		rmoves = 2
	if (r2 + c2) % 2 != (r1 + c1) % 2:
		bmoves = 0
	elif x == y:
		bmoves = 1
	else:
		bmoves = 2
	print(rmoves, bmoves, kmoves)


n = input()
a = n.split()
for x in range(4):
	a[x] = int(a[x])
rook = 0
if a[0] != a[2]:
	rook += 1
if a[1] != a[3]:
	rook += 1
bishop = 0
if (a[0] + a[1]) % 2 == (a[2] + a[3]) % 2:
	if abs(a[0] - a[2]) == abs(a[1] - a[3]):
		bishop = 1
	else:
		bishop = 2
if abs(a[0] - a[2]) > abs(a[1] - a[3]):
	king = abs(a[0] - a[2])
else:
	king = abs(a[1] - a[3])
print(rook, bishop, king)


def f(l):
	ab = lambda x: x if x > 0 else -x
	(r1, c1, r2, c2) = l
	r = 1 if r1 == r2 or c1 == c2 else 2
	b = (1 if r2 - r1 == c1 - c2 or r2 - r1 == c2 - c1 else 2) if (r1 + r2 + c1 + c2) % 2 == 0 else 0
	k = max(ab(r2 - r1), ab(c2 - c1))
	return [r, b, k]
l = list(map(int, input().split()))
print(*f(l))


from math import ceil
d = {'r': 0, 'b': 0, 'k': 0}
(r1, c1, r2, c2) = map(int, input().split())
if r1 != r2:
	d['r'] = d['r'] + 1
if c1 != c2:
	d['r'] = d['r'] + 1
if (abs(r1 - r2) + abs(c1 - c2)) % 2 == 1:
	d['b'] = 0
elif c1 - c2 != 0 and (r1 - r2) / (c1 - c2) == -1 or (c1 - c2 != 0 and (r1 - r2) / (c1 - c2) == 1):
	d['b'] = 1
elif (abs(r1 - r2) + abs(c1 - c2)) % 2 == 0:
	d['b'] = 2
y1 = -(r1 - c1 - r2)
y2 = r1 + c1 - r2
x1 = r1 - c1 + c2
x2 = r1 + c1 - c2
d1 = pow(pow(x1 - r1, 2) + pow(c2 - c1, 2), 1 / 2) / pow(2, 1 / 2) + abs(x1 - r2)
d2 = pow(pow(x2 - r1, 2) + pow(c2 - c1, 2), 1 / 2) / pow(2, 1 / 2) + abs(x2 - r2)
d3 = pow(pow(r2 - r1, 2) + pow(c1 - y2, 2), 1 / 2) / pow(2, 1 / 2) + abs(c2 - y2)
d4 = pow(pow(r2 - r1, 2) + pow(c1 - y1, 2), 1 / 2) / pow(2, 1 / 2) + abs(c2 - y1)
d5 = abs(r2 - r1) + abs(c2 - c1)
d['k'] = min(d1, d2, d3, d4, d5)
for i in d:
	print(int(ceil(d[i])), end=' ')


(r1, c1, r2, c2) = map(int, input().split())

def rook(r1, c1, r2, c2):
	if r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def bishop(r1, c1, r2, c2):
	if (r1 + c1) % 2 != (r2 + c2) % 2:
		return 0
	elif r1 - c1 == r2 - c2 or r1 + c1 == r2 + c2:
		return 1
	else:
		return 2

def king(r1, c1, r2, c2):
	return max(abs(r1 - r2), abs(c1 - c2))
r = rook(r1, c1, r2, c2)
b = bishop(r1, c1, r2, c2)
k = king(r1, c1, r2, c2)
print(r, b, k)


(x1, y1, x2, y2) = map(int, input().split(' '))
disX = int(((x1 - x2) ** 2) ** 0.5)
disY = int(((y1 - y2) ** 2) ** 0.5)
if x1 == x2 and y1 == y2:
	print('0', end=' ')
elif x1 == x2 or y1 == y2:
	print('1', end=' ')
else:
	print('2', end=' ')
if disX == disY:
	print('1', end=' ')
elif disX % 2 == disY % 2:
	print('2', end=' ')
else:
	print('0', end=' ')
if disX > disY:
	print(disX, end=' ')
else:
	print(disY, end=' ')


import sys
from collections import defaultdict
mod = 1000000007

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

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

def input():
	return sys.stdin.readline()

def print_array(a):
	print(' '.join(map(str, a)))

def main():
	(a, b, x, y) = get_ints()
	m = []
	if a == x or b == y:
		m.append(1)
	else:
		m.append(2)
	if (a + b) % 2 != (x + y) % 2:
		m.append(0)
	elif a + b == x + y or a - b == x - y:
		m.append(1)
	else:
		m.append(2)
	m.append(abs(a - x) if abs(a - x) > abs(b - y) else abs(b - y))
	print_array(m)
main()


(x, y, x1, y1) = map(int, input().split())
if x1 == x or y1 == y:
	print(1, end=' ')
else:
	print(2, end=' ')
if (x + y) % 2 != (x1 + y1) % 2:
	print(0, end=' ')
elif abs(x - x1) == abs(y - y1):
	print(1, end=' ')
else:
	print(2, end=' ')
if x1 == x:
	print(abs(y - y1), end=' ')
elif y1 == y:
	print(abs(x - x1), end=' ')
else:
	print(abs(abs(x - x1) - abs(y - y1)) + min(abs(x - x1), abs(y - y1)), end=' ')


(r, c, r1, c1) = map(int, input().split())
rk = 1 if r == r1 or c == c1 else 2
b = 0 if (r + c) % 2 != (r1 + c1) % 2 else 1 if abs(r - r1) == abs(c - c1) else 2
k = max(abs(r1 - r), abs(c1 - c))
print(rk, b, k)


import math
from collections import Counter
import math
(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2 or c1 == c2:
	a = 1
else:
	a = 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	b = 0
elif r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
	b = 1
else:
	b = 2
c = max(abs(r1 - r2), abs(c1 - c2))
print(a, b, c)


(a, b, x, y) = map(int, input().split())
r = int(x != a) + int(y != b)
k = min(abs(x - a), abs(y - b)) + (max(abs(x - a), abs(y - b)) - min(abs(x - a), abs(y - b)))
if (x + y) % 2 != (a + b) % 2:
	p = 0
else:
	p = 1 + int(abs(x - a) != abs(y - b))
print(r, p, k)


from math import ceil, sqrt

def main():
	(r1, c1, r2, c2) = map(int, input().split())
	if r1 == r2 and c1 != c2:
		rook = 1
	elif r1 != r2 and c1 == c2:
		rook = 1
	elif r1 != r2 and c1 != c2:
		rook = 2
	else:
		rook = 0
	if (r1 + c1) % 2 == 0 and (r2 + c2) % 2 != 0:
		bishop = 0
	elif (r1 + c1) % 2 != 0 and (r2 + c2) % 2 == 0:
		bishop = 0
	else:
		try:
			if (c2 - c1) / (r2 - r1) == 1 or (c2 - c1) / (r2 - r1) == -1:
				bishop = 1
			else:
				bishop = 2
		except:
			bishop = 2
	(d1, d2) = (0, 0)
	if r1 > r2:
		d1 = r1 - r2
	if c1 > c2:
		d2 = c1 - c2
	if d1 > 0:
		r2 = r1 + d1
	if d2 > 0:
		c2 = c1 + d2
	king = 0
	while True:
		if r1 == r2 and c1 != c2:
			flag = 1
			break
		if c1 == c2 and r1 != r2:
			flag = 2
			break
		if abs(r1 - r2) == abs(c1 - c2):
			flag = 3
			break
		r1 += 1
		c1 += 1
		king += 1
	if flag == 1:
		king += abs(c1 - c2)
	elif flag == 2:
		king += abs(r1 - r2)
	elif flag == 3:
		king += ceil(sqrt((r1 - r2) ** 2 + (c1 - c2) ** 2) / sqrt(2))
	print(rook, bishop, king)
main()


(r1, c1, r2, c2) = map(int, input().split())
b = 0
if (r1 + c1) % 2 == (r2 + c2) % 2:
	b = 1 + (r1 - c1 != r2 - c2 and r1 + c1 != r2 + c2)
print((r1 != r2) + (c1 != c2), b, max(abs(r1 - r2), abs(c1 - c2)))


(r1, c1, r2, c2) = input().split()
(r1, c1, r2, c2) = (int(r1), int(c1), int(r2), int(c2))
lt = []
if r1 == r2 or c1 == c2:
	lt.append(1)
else:
	lt.append(2)
if (r1 + r2 + c1 + c2) % 2 == 0:
	if abs(r2 - r1) == abs(c2 - c1):
		lt.append(1)
	else:
		lt.append(2)
else:
	lt.append(0)
lt.append(max(abs(r2 - r1), abs(c2 - c1)))
print(*lt)


(r1, c1, r2, c2) = map(int, input().split())
if r1 == r2 or c1 == c2:
	l = 1
else:
	l = 2
if (r1 + c1) % 2 != (r2 + c2) % 2:
	s = 0
elif r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
	s = 1
else:
	s = 2
k = max(abs(r1 - r2), abs(c1 - c2))
print(l, s, k)


(r1, c1, r2, c2) = map(int, input().strip().split(' '))
r = 0
b = 0
k = 0
if r1 == r2 or c1 == c2:
	r = 1
else:
	r = 2
k = max(abs(r2 - r1), abs(c2 - c1))
l1 = abs(r2 - r1)
l2 = abs(c1 - c2)
if l1 % 2 == 0 and l2 % 2 != 0 or (l1 % 2 != 0 and l2 % 2 == 0):
	b = 0
elif l1 == l2:
	b = 1
else:
	b = 2
print(r, b, k, end=' ')


def rook(num):
	lst = num.split(' ')
	(r1, c1, r2, c2) = (int(lst[0]), int(lst[1]), int(lst[2]), int(lst[3]))
	if r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def bishop(num):
	lst = num.split(' ')
	(r1, c1, r2, c2) = (int(lst[0]), int(lst[1]), int(lst[2]), int(lst[3]))
	if not ((r1 % 2 == 0) != (c1 % 2 == 0)) != ((r2 % 2 == 0) != (c2 % 2 == 0)):
		if abs(r2 - r1) == abs(c2 - c1):
			return 1
		else:
			return 2
	else:
		return 0

def king(num):
	lst = num.split(' ')
	(r1, c1, r2, c2) = (int(lst[0]), int(lst[1]), int(lst[2]), int(lst[3]))
	if (abs(r2 - r1) == 1 or abs(c2 - c1) == 1) and abs(r2 - r1) <= 1 and (abs(c2 - c1) <= 1):
		return 1
	elif abs(r2 - r1) == abs(c2 - c1):
		return abs(r2 - r1)
	elif abs(r2 - r1) < abs(c2 - c1):
		return abs(c2 - c1)
	else:
		return abs(r2 - r1)
num = input()
print(rook(num), bishop(num), king(num))


from math import fabs
a = [int(i) for i in input().split()]
if (a[0] == a[2]) | (a[1] == a[3]):
	print(1, end=' ')
else:
	print(2, end=' ')
(b, c) = (fabs(a[2] - a[0]), fabs(a[3] - a[1]))
if b % 2 != c % 2:
	print(0, end=' ')
elif b == c:
	print(1, end=' ')
else:
	print(2, end=' ')
print(int(max(fabs(a[2] - a[0]), fabs(a[3] - a[1]))))


(bx, by, ex, ey) = list(map(int, input().split()))
arr = []
if bx == ex or by == ey:
	print(1, end=' ')
else:
	print(2, end=' ')
if (bx + by) % 2 == (ex + ey) % 2:
	if bx + by == ex + ey or bx - by == ex - ey:
		print(1, end=' ')
	else:
		print(2, end=' ')
else:
	print(0, end=' ')
print(max(abs(bx - ex), abs(by - ey)))


a = input()
r1 = int(a[0])
c1 = int(a[2])
r2 = int(a[4])
c2 = int(a[6])
if r1 == r2 or c1 == c2:
	if r1 == r2 and c1 == c2:
		print(0, end=' ')
	else:
		print(1, end=' ')
else:
	print(2, end=' ')
if abs(r1 - r2) == abs(c1 - c2):
	if r1 == r2 and c1 == c2:
		print(0, end=' ')
	else:
		print(1, end=' ')
elif (r1 % 2 == 0 and c1 % 2 == 0 or (r1 % 2 != 0 and c1 % 2 != 0)) != (r2 % 2 == 0 and c2 % 2 == 0 or (r2 % 2 != 0 and c2 % 2 != 0)):
	print(0, end=' ')
else:
	print(2, end=' ')
if abs(r1 - r2) >= abs(c1 - c2):
	print(abs(r1 - r2))
elif abs(c1 - c2) >= abs(r1 - r2):
	print(abs(c1 - c2))
else:
	print(0)


def main():
	(start_row, start_col, end_row, end_col) = (int(i) for i in input().split())
	if start_row == end_row or start_col == end_col:
		moves_rook = 1
	else:
		moves_rook = 2
	color_start_p = get_color(start_row, start_col)
	color_end_p = get_color(end_row, end_col)
	if color_start_p == color_end_p:
		if abs(start_row - end_row) == abs(start_col - end_col):
			moves_bishop = 1
		else:
			moves_bishop = 2
	else:
		moves_bishop = 0
	if abs(start_row - end_row) < abs(start_col - end_col):
		moves_king = abs(start_col - end_col)
	else:
		moves_king = abs(start_row - end_row)
	print(moves_rook, moves_bishop, moves_king)

def get_color(r, c):
	if r % 2 == 0:
		if c % 2 == 0:
			return 1
		else:
			return -1
	elif c % 2 == 0:
		return -1
	else:
		return 1
main()


(r1, c1, r2, c2) = [int(i) for i in input().split()]
ans = str()
if r1 == r2 or c1 == c2:
	ans += '1 '
else:
	ans += '2 '
if (r1 + c1) % 2 == 0 and (r2 + c2) % 2 == 1 or ((r2 + c2) % 2 == 0 and (r1 + c1) % 2 == 1):
	ans += '0 '
elif r1 + c1 == r2 + c2 or r2 - c2 == r1 - c1:
	ans += '1 '
else:
	ans += '2 '
ans += str(max(abs(r2 - r1), abs(c2 - c1)))
print(ans)


def sign(num):
	return -1 if num < 0 else 1

def rook(cord):
	if cord[0] == cord[2] and cord[1] == cord[3]:
		return 0
	if cord[0] == cord[2] or cord[1] == cord[3]:
		return 1
	return 2

def bishop(cord):
	if (cord[0] + cord[1]) % 2 != (cord[2] + cord[3]) % 2:
		return 0
	elif cord[0] - cord[1] == cord[2] - cord[3] or cord[0] + cord[1] == cord[2] + cord[3]:
		return 1
	return 2

def king(cord):
	return max(abs(cord[0] - cord[2]), abs(cord[1] - cord[3]))
cord = list(map(int, input().split()))
print(rook(cord), bishop(cord), king(cord))


(r1, c1, r2, c2) = [int(i) for i in input().split()]
dr = abs(r1 - r2)
dc = abs(c1 - c2)
result = [0] * 3
result[0] = 1 if dr == 0 or dc == 0 else 2
if dr == dc:
	result[1] = 1
elif (dr + dc) % 2 == 1:
	result[1] = 0
else:
	result[1] = 2
result[2] = max(dr, dc)
print(' '.join([str(i) for i in result]))


(rook, r1, c1, r2, c2) = tuple([2] + [int(i) for i in input().split()])
(dr, dc) = (abs(r2 - r1), abs(c2 - c1))
if r2 == r1:
	rook -= 1
if c2 == c1:
	rook -= 1
if (r1 + c1) % 2 == (r2 + c2) % 2:
	if dr == dc:
		bishop = 1
	else:
		bishop = 2
else:
	bishop = 0
if dr > dc:
	king = dr
else:
	king = dc
print('{} {} {}'.format(rook, bishop, king))


(r1, c1, r2, c2) = [int(i) for i in input().split()]
if r1 == r2 or c1 == c2:
	print(1, end=' ')
else:
	print(2, end=' ')
if (r1 + c1) % 2 != (r2 + c2) % 2:
	print(0, end=' ')
elif abs(r2 - r1) == abs(c2 - c1):
	print(1, end=' ')
else:
	print(2, end=' ')
print(max(abs(r2 - r1), abs(c2 - c1)))


a = input().split()
x1 = int(a[0])
y1 = int(a[1])
x2 = int(a[2])
y2 = int(a[3])
rook = 0
bishop = 0
king = 0
if (y1 == y2) ^ (x1 == x2):
	rook = 1
elif y1 == y2 and x1 == x2:
	rook = 0
else:
	rook = 2
if x1 == x2 and y1 == y2 or abs(x1 - x2) % 2 != abs(y1 - y2) % 2:
	bishop = 0
elif abs(x1 - x2) == abs(y1 - y2):
	bishop = 1
else:
	bishop = 2
while x1 != x2 and y1 != y2:
	if x1 < x2:
		x1 += 1
	elif x1 > x2:
		x1 -= 1
	if y1 < y2:
		y1 += 1
	elif y1 > y2:
		y2 += 1
	king += 1
while x1 != x2:
	if x1 < x2:
		x1 += 1
	elif x1 > x2:
		x1 -= 1
	king += 1
while y1 != y2:
	if y1 < y2:
		y1 += 1
	elif y1 > y2:
		y2 += 1
	king += 1
print(rook, bishop, king)


def rook_moves(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		return 0
	elif r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def king_moves(r1, c1, r2, c2):
	if r1 == r2 or c1 == c2:
		return max(abs(r1 - r2), abs(c1 - c2))
	elif abs(r1 - r2) == abs(c1 - c2):
		return abs(r1 - r2)
	else:
		return max(abs(r1 - r2), abs(c1 - c2))

def bishop_moves(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		return 0
	elif (r1 + c1) % 2 != (r2 + c2) % 2:
		return 0
	elif abs(r1 - r2) == abs(c1 - c2):
		return 1
	else:
		return 2

def main():
	(r1, c1, r2, c2) = [int(x) for x in input().split()]
	king = king_moves(r1, c1, r2, c2)
	rook = rook_moves(r1, c1, r2, c2)
	bishop = bishop_moves(r1, c1, r2, c2)
	print(rook, bishop, king)
main()


(r1, c1, r2, c2) = map(int, input().split())
(dr, dc) = (abs(r1 - r2), abs(c1 - c2))
(x, y) = divmod(dr - dc, 2)
print(1 + (dr * dc > 0), (1 - y) * (1 + bool(x)), max(dr, dc))


import sys
alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')

def k(r1, c1, r2, c2):
	diffr = abs(r1 - r2)
	diffc = abs(c1 - c2)
	moves = max(diffc, diffr)
	return moves

def r(r1, c1, r2, c2):
	if r1 == r2 and c1 == c2:
		return 0
	elif r1 == r2 or c1 == c2:
		return 1
	else:
		return 2

def b(r1, c1, r2, c2):
	if (r1 + c1) % 2 != (r2 + c2) % 2:
		return 0
	elif abs(r1 - r2) == abs(c1 - c2):
		return 1
	else:
		return 2
(r1, c1, r2, c2) = map(int, input().split())
print(r(r1, c1, r2, c2), b(r1, c1, r2, c2), k(r1, c1, r2, c2))


v = input()
(ro, co, rf, cf) = [int(i) for i in v.split()]
result = list()
if ro == rf and co == cf:
	result.append(0)
elif ro == rf or co == cf:
	result.append(1)
else:
	result.append(2)
if (ro + co) % 2 != (rf + cf) % 2:
	result.append(0)
elif ro == rf and co == cf:
	result.append(0)
elif ro + co == rf + cf or ro - co == rf - cf:
	result.append(1)
else:
	result.append(2)
result.append(max(abs(ro - rf), abs(co - cf)))
print(str(result[0]) + ' ' + str(result[1]) + ' ' + str(result[2]))


import sys
(r1, c1, r2, c2) = map(int, input().split())
first = 1 if r1 == r2 or c1 == c2 else 2
second = 1 if abs(r1 - r2) == abs(c1 - c2) else 0 if (r1 + r2 + c1 + c2) % 2 == 1 else 2
third = max(abs(r1 - r2), abs(c1 - c2))
print(str(first) + ' ' + str(second) + ' ' + str(third))


(s1, s2, f1, f2) = [int(i) for i in input().split()]
if s1 == f1 or s2 == f2:
	print('1', end=' ')
else:
	print('2', end=' ')
if not (s1 % 2 == s2 % 2) ^ (f1 % 2 == f2 % 2):
	if abs(f1 - s1) == abs(f2 - s2):
		print(1, end=' ')
	else:
		print(2, end=' ')
else:
	print(0, end=' ')
print(max(abs(s1 - f1), abs(s2 - f2)))