
'''simple docstring'''
import os







def 		A_(     A						:		Optional[Any]):
							UpperCamelCase   			=     len(grid[0])
							UpperCamelCase   			=     len(A)

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

																					UpperCamelCase   			=     max(
																					    A		,     A		,     A		,     A)
																					if max_product > largest:
																												UpperCamelCase   			=     max_product

							return largest







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

							UpperCamelCase   			=     [[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 string import ascii_lowercase, ascii_uppercase







def 		A_(     A						:		str):
							if not sentence:
														return ""
							UpperCamelCase   			=     dict(zip(A		,     A))
							return lower_to_upper.get(sentence[0]		,     sentence[0]) + sentence[1:]


if __name__ == "__main__":
						from doctest import testmod

						testmod()




