






import os




def      __A					(     _lowercase ):

					'''simple docstring'''







					_A								= len(grid[0] )
					_A								= len(_lowercase )

					_A								= 0
					_A								= 0
					_A								= 0

					# Check vertically, horizontally, diagonally at the same time (only works
					# for nxn grid)
					for i in range(_lowercase ):
										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(
															    _lowercase					,			_lowercase					,			_lowercase					,			_lowercase )
															if max_product > largest:
																				_A								= max_product

					return largest




def      __A					(     ):

					'''simple docstring'''







					_A								= []
					with open(os.path.dirname(_lowercase ) + '''/grid.txt''' ) as file:
										for line in file:
															grid.append(line.strip('''\n''' ).split(''' ''' ) )

					_A								= [[int(_lowercase ) for i in grid[j]] for j in range(len(_lowercase ) )]

					return largest_product(_lowercase )


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











from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


__A      =				{
    'configuration_mega': ['MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MegaConfig', 'MegaOnnxConfig'],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__A      =				[
				    'MEGA_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'MegaForCausalLM',
				    'MegaForMaskedLM',
				    'MegaForMultipleChoice',
				    'MegaForQuestionAnswering',
				    'MegaForSequenceClassification',
				    'MegaForTokenClassification',
				    'MegaModel',
				    'MegaPreTrainedModel',
				]

if TYPE_CHECKING:
				from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_mega import (
								    MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
								    MegaForCausalLM,
								    MegaForMaskedLM,
								    MegaForMultipleChoice,
								    MegaForQuestionAnswering,
								    MegaForSequenceClassification,
								    MegaForTokenClassification,
								    MegaModel,
								    MegaPreTrainedModel,
								)

else:
				import sys

				__A      =				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



