
import os




def 			_SCREAMING_SNAKE_CASE      (	_lowerCamelCase				:    List[str])      ->					Union[str, Any]:






							'''simple docstring'''





							__UpperCamelCase			:     Any         =      len(grid[0])
							__UpperCamelCase			:     List[str]         =      len(_lowerCamelCase)

							__UpperCamelCase			:     Any         =      0
							__UpperCamelCase			:     Any         =      0
							__UpperCamelCase			:     Any         =      0

							# Check vertically, horizontally, diagonally at the same time (only works
							# for nxn grid)
							for i in range(_lowerCamelCase):
														for j in range(n_rows - 3):
																					__UpperCamelCase			:     List[str]         =      grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
																					__UpperCamelCase			:     Optional[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:
																												__UpperCamelCase			:     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:
																												__UpperCamelCase			:     Optional[int]         =      (
																												    grid[i][j]
																												    * grid[i - 1][j + 1]
																												    * grid[i - 2][j + 2]
																												    * grid[i - 3][j + 3]
																												)

																					__UpperCamelCase			:     List[Any]         =      max(
																					    _lowerCamelCase		,						_lowerCamelCase		,						_lowerCamelCase		,						_lowerCamelCase)
																					if max_product > largest:
																												__UpperCamelCase			:     Tuple         =      max_product

							return largest




def 			_SCREAMING_SNAKE_CASE      (	)      ->					Any:






							'''simple docstring'''





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

							__UpperCamelCase			:     Union[str, Any]         =      [[int(_lowerCamelCase) for i in grid[j]] for j in range(len(_lowerCamelCase))]

							return largest_product(_lowerCamelCase)


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

from typing import TYPE_CHECKING

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


lowercase						:      List[Any]									= {'configuration_swin': ['SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SwinConfig', 'SwinOnnxConfig']}


try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase						:      Dict									= [
		    'SWIN_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'SwinForImageClassification',
		    'SwinForMaskedImageModeling',
		    'SwinModel',
		    'SwinPreTrainedModel',
		    'SwinBackbone',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase						:      Optional[int]									= [
		    'TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TFSwinForImageClassification',
		    'TFSwinForMaskedImageModeling',
		    'TFSwinModel',
		    'TFSwinPreTrainedModel',
		]

if TYPE_CHECKING:
		from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_swin import (
				    SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
				    SwinBackbone,
				    SwinForImageClassification,
				    SwinForMaskedImageModeling,
				    SwinModel,
				    SwinPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_swin import (
				    TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFSwinForImageClassification,
				    TFSwinForMaskedImageModeling,
				    TFSwinModel,
				    TFSwinPreTrainedModel,
				)

else:
		import sys

		lowercase						:      Optional[Any]									= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)