





import os


def 							SCREAMING_SNAKE_CASE__						(    __a   ):
	snake_case_		:			List[str]											=	len(grid[0]   )
	snake_case_		:			Optional[Any]											=	len(__a   )

	snake_case_		:			Any											=	0
	snake_case_		:			Optional[int]											=	0
	snake_case_		:			str											=	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   ):
			snake_case_		:			int											=	grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
			snake_case_		:			List[Any]											=	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:
				snake_case_		:			List[Any]											=	(
				    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:
				snake_case_		:			Dict											=	(
				    grid[i][j]
				    * grid[i - 1][j + 1]
				    * grid[i - 2][j + 2]
				    * grid[i - 3][j + 3]
				)

			snake_case_		:			str											=	max(
			    __a   , __a   , __a   , __a   )
			if max_product > largest:
				snake_case_		:			Any											=	max_product

	return largest


def 							SCREAMING_SNAKE_CASE__						(    ):
	snake_case_		:			Optional[Any]											=	[]
	with open(os.path.dirname(__a   ) + '/grid.txt'   ) as file:
		for line in file:
			grid.append(line.strip('\n'   ).split(' '   )   )

	snake_case_		:			Optional[Any]											=	[[int(__a   ) for i in grid[j]] for j in range(len(__a   )   )]

	return largest_product(__a   )


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








from ....utils import logging


_SCREAMING_SNAKE_CASE      	=		logging.get_logger(__name__)
class SCREAMING_SNAKE_CASE_						(					snake_case_					):






						def __init__(      self      :      str		,   _A      :      List[Any]		,   _A      :      List[Any]=None		,   _A      :      str=2048	)							->    Optional[int]:







							"""simple docstring"""


							snake_case_		:			Tuple											=	config.__dict__
							snake_case_		:			List[str]											=	modal_hidden_size
							if num_labels:
								snake_case_		:			int											=	num_labels

