






import os
def      a_ (      _A  )			->			Optional[int]:







				"""simple docstring"""
				snake_case__									=     len(grid[0]  )
				snake_case__									=     len(_A  )

				snake_case__									=     0
				snake_case__									=     0
				snake_case__									=     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__									=     grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
												snake_case__									=     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__									=     (
																    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__									=     (
																    grid[i][j]
																    * grid[i - 1][j + 1]
																    * grid[i - 2][j + 2]
																    * grid[i - 3][j + 3]
																)

												snake_case__									=     max(
												    _A      ,   _A      ,   _A      ,   _A  )
												if max_product > largest:
																snake_case__									=     max_product

				return largest
def      a_ (      )			->			Any:







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

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

				return largest_product(_A  )


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












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available


__UpperCamelCase					:		str	  =						{}

try:
							if not is_sentencepiece_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__UpperCamelCase					:		Dict	  =						["""BartphoTokenizer"""]

if TYPE_CHECKING:
							try:
														if not is_sentencepiece_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_bartpho import BartphoTokenizer

else:
							import sys

							__UpperCamelCase					:		Any	  =						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




