
'''simple docstring'''
import os






def      UpperCamelCase_				(      A__						):
	a_      				=						len(grid[0]						)
	a_      				=						len(A__						)

	a_      				=						0
	a_      				=						0
	a_      				=						0

	# Check vertically, horizontally, diagonally at the same time (only works
	# for nxn grid)
	for i in range(A__						):
		for j in range(n_rows - 3						):
			a_      				=						grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
			a_      				=						grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

			# Left-to-right diagonal (\) product
			if i < n_columns - 3:
				a_      				=						(
				    grid[i][j]
				    * grid[i + 1][j + 1]
				    * grid[i + 2][j + 2]
				    * grid[i + 3][j + 3]
				)

			# Right-to-left diagonal(/) product
			if i > 2:
				a_      				=						(
				    grid[i][j]
				    * grid[i - 1][j + 1]
				    * grid[i - 2][j + 2]
				    * grid[i - 3][j + 3]
				)

			a_      				=						max(
			    A__  ,      A__  ,      A__  ,      A__						)
			if max_product > largest:
				a_      				=						max_product

	return largest






def      UpperCamelCase_				(      ):
	a_      				=						[]
	with open(os.path.dirname(A__						) + """/grid.txt"""						) as file:
		for line in file:
			grid.append(line.strip("""\n"""						).split(""" """						)						)

	a_      				=						[[int(A__						) for i in grid[j]] for j in range(len(A__						)						)]

	return largest_product(A__						)


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


'''simple docstring'''
import enum
import shutil
import sys


lowercase__				, lowercase__											=shutil.get_terminal_size()

lowercase__											={'UP': 'A', 'DOWN': 'B', 'RIGHT': 'C', 'LEFT': 'D'}







class   a_ (      enum.Enum					):
			lowerCamelCase__	:			int       =    0
			lowerCamelCase__	:			Union[str, Any]       =    1







def      UpperCamelCase_				(      A__  ,      A__=""						):
	sys.stdout.write(str(A__						) + end						)
	sys.stdout.flush()






def      UpperCamelCase_				(      A__  ,      A__  ,      A__=""						):
	forceWrite(F'''\u001b[{color}m{content}\u001b[0m'''  ,      A__						)






def      UpperCamelCase_				(      ):
	forceWrite("""\r"""						)






def      UpperCamelCase_				(      A__  ,      A__						):
	forceWrite(F'''\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'''						)






def      UpperCamelCase_				(      ):
	forceWrite(""" """ * TERMINAL_WIDTH						)
	reset_cursor()






def      UpperCamelCase_				(      ):
	reset_cursor()
	forceWrite("""-""" * TERMINAL_WIDTH						)
