




"""simple docstring"""
import os





def 						UpperCAmelCase				(			A__:    int     )  ->     Optional[Any]:
			__lowerCamelCase					:	str	       =				len(grid[0]     )
			__lowerCamelCase					:	Any	       =				len(A__     )

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

									__lowerCamelCase					:	List[str]	       =				max(
									    A__							,				A__							,				A__							,				A__     )
									if max_product > largest:
												__lowerCamelCase					:	Any	       =				max_product

			return largest





def 						UpperCAmelCase				(			)  ->     Any:
			__lowerCamelCase					:	Optional[int]	       =				[]
			with open(os.path.dirname(A__     ) + '/grid.txt'     ) as file:
						for line in file:
									grid.append(line.strip('\n'     ).split(' '     )     )

			__lowerCamelCase					:	Union[str, 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"""
import random
from typing import Any





def 						UpperCAmelCase				(			A__:    list     )  ->     list[Any]:
			for _ in range(len(A__     )     ):
						__lowerCamelCase					:	List[Any]	       =				random.randint(0							,				len(A__     ) - 1     )
						__lowerCamelCase					:	Optional[Any]	       =				random.randint(0							,				len(A__     ) - 1     )
						__lowerCamelCase       ,      __lowerCamelCase					:	Any	       =				data[b], data[a]
			return data


if __name__ == "__main__":
					a_				:    Any										=     [0, 1, 2, 3, 4, 5, 6, 7]
					a_				:    int										=     ['''python''', '''says''', '''hello''', '''!''']
					print('''Fisher-Yates Shuffle:''')
					print('''List''', integers, strings)
					print('''FY Shuffle''', fisher_yates_shuffle(integers), fisher_yates_shuffle(strings))



