

'''simple docstring'''



import os
def 		__lowerCamelCase			(  __snake_case	:						Any			)			->				List[Any]:






						"""simple docstring"""





						A__	:  Any           =len(grid[0]			)
						A__	:  Any           =len(__a			)

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

																		A__	:  Dict           =max(
																		    __a,						__a,						__a,						__a			)
																		if max_product > largest:
																								A__	:  Optional[Any]           =max_product

						return largest
def 		__lowerCamelCase			(  )			->				Tuple:






						"""simple docstring"""





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

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

						return largest_product(__a			)


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






"""simple docstring"""







from typing import TYPE_CHECKING

from ...file_utils import _LazyModule, is_torch_available
from ...utils import OptionalDependencyNotAvailable


a_							=    {
    """configuration_gpt_neox_japanese""": ["""GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTNeoXJapaneseConfig"""],
    """tokenization_gpt_neox_japanese""": ["""GPTNeoXJapaneseTokenizer"""],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	a_							=    [
	    """GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """GPTNeoXJapaneseForCausalLM""",
	    """GPTNeoXJapaneseLayer""",
	    """GPTNeoXJapaneseModel""",
	    """GPTNeoXJapanesePreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_gpt_neox_japanese import GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig
	from .tokenization_gpt_neox_japanese import GPTNeoXJapaneseTokenizer

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_gpt_neox_japanese import (
		    GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST,
		    GPTNeoXJapaneseForCausalLM,
		    GPTNeoXJapaneseLayer,
		    GPTNeoXJapaneseModel,
		    GPTNeoXJapanesePreTrainedModel,
		)


else:
	import sys

	a_							=    _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





