


'''simple docstring'''
import os


def       a				(      )  ->     int:



					'''simple docstring'''






					with open(os.path.dirname(__a       ) + '''/grid.txt'''       ) as f:
										UpperCamelCase__       :Dict							 =			[]  # noqa: E741
										for _ in range(20       ):
															l.append([int(__a       ) for x in f.readline().split()]       )

										UpperCamelCase__       :Union[str, Any]							 =			0

										# right
										for i in range(20       ):
															for j in range(17       ):
																				UpperCamelCase__       :Dict							 =			l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																				if temp > maximum:
																									UpperCamelCase__       :Optional[int]							 =			temp

        # down
										for i in range(17       ):
															for j in range(20       ):
																				UpperCamelCase__       :Optional[int]							 =			l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																				if temp > maximum:
																									UpperCamelCase__       :List[str]							 =			temp

        # diagonal 1
										for i in range(17       ):
															for j in range(17       ):
																				UpperCamelCase__       :Dict							 =			l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																				if temp > maximum:
																									UpperCamelCase__       :Union[str, Any]							 =			temp

        # diagonal 2
										for i in range(17       ):
															for j in range(3			, 20       ):
																				UpperCamelCase__       :Tuple							 =			l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																				if temp > maximum:
																									UpperCamelCase__       :Tuple							 =			temp
										return maximum


if __name__ == "__main__":
		print(solution())



'''simple docstring'''
from __future__ import annotations

__snake_case											=					list[list[int]]

# assigning initial values to the grid
__snake_case											=					[
    [3, 0, 6, 5, 0, 8, 4, 0, 0],
    [5, 2, 0, 0, 0, 0, 0, 0, 0],
    [0, 8, 7, 0, 0, 0, 0, 3, 1],
    [0, 0, 3, 0, 1, 0, 0, 8, 0],
    [9, 0, 0, 8, 6, 3, 0, 0, 5],
    [0, 5, 0, 0, 9, 0, 6, 0, 0],
    [1, 3, 0, 0, 0, 0, 2, 5, 0],
    [0, 0, 0, 0, 0, 0, 0, 7, 4],
    [0, 0, 5, 2, 0, 6, 3, 0, 0],
]

# a grid with no solution
__snake_case											=					[
    [5, 0, 6, 5, 0, 8, 4, 0, 3],
    [5, 2, 0, 0, 0, 0, 0, 0, 2],
    [1, 8, 7, 0, 0, 0, 0, 3, 1],
    [0, 0, 3, 0, 1, 0, 0, 8, 0],
    [9, 0, 0, 8, 6, 3, 0, 0, 5],
    [0, 5, 0, 0, 9, 0, 6, 0, 0],
    [1, 3, 0, 0, 0, 0, 2, 5, 0],
    [0, 0, 0, 0, 0, 0, 0, 7, 4],
    [0, 0, 5, 2, 0, 6, 3, 0, 0],
]


def       a				(      __a			, __a			, __a			, __a       )  ->     bool:



					'''simple docstring'''






					for i in range(9       ):
										if grid[row][i] == n or grid[i][column] == n:
															return False

					for i in range(3       ):
										for j in range(3       ):
															if grid[(row - row % 3) + i][(column - column % 3) + j] == n:
																				return False

					return True


def       a				(      __a       )  ->     tuple[int, int] | None:



					'''simple docstring'''






					for i in range(9       ):
										for j in range(9       ):
															if grid[i][j] == 0:
																				return i, j
					return None


def       a				(      __a       )  ->     Matrix | None:



					'''simple docstring'''






					if location := find_empty_location(__a       ):
										UpperCamelCase__ ,    UpperCamelCase__       :Optional[int]							 =			location
					else:
										# If the location is ``None``, then the grid is solved.
										return grid

					for digit in range(1			, 10       ):
										if is_safe(__a			, __a			, __a			, __a       ):
															UpperCamelCase__       :Tuple							 =			digit

															if sudoku(__a       ) is not None:
																				return grid

															UpperCamelCase__       :Union[str, Any]							 =			0

					return None


def       a				(      __a       )  ->     None:



					'''simple docstring'''






					for row in grid:
										for cell in row:
															print(__a			, end=''' '''       )
										print()


if __name__ == "__main__":
		# make a copy of grid so that you can compare with the unmodified grid
		for example_grid in (initial_grid, no_solution):
				print('''\nExample grid:\n''' + '''=''' * 20)
				print_solution(example_grid)
				print('''\nExample grid solution:''')
				__snake_case											=					sudoku(example_grid)
				if solution is not None:
						print_solution(solution)
				else:
						print('''Cannot find a solution.''')