



"""simple docstring"""






import os






def   snake_case__     (	__lowerCamelCase       :					str			):
			"""simple docstring"""
			lowerCamelCase__	:	List[Any]				=len(grid[0]			)
			lowerCamelCase__	:	Tuple				=len(__lowerCamelCase			)

			lowerCamelCase__	:	Any				=0
			lowerCamelCase__	:	List[Any]				=0
			lowerCamelCase__	:	List[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			):
									lowerCamelCase__	:	Dict				=grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
									lowerCamelCase__	:	Dict				=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__	:	Union[str, 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__	:	Dict				=(
												    grid[i][j]
												    * grid[i - 1][j + 1]
												    * grid[i - 2][j + 2]
												    * grid[i - 3][j + 3]
												)

									lowerCamelCase__	:	Dict				=max(
									    __lowerCamelCase							,	__lowerCamelCase							,	__lowerCamelCase							,	__lowerCamelCase			)
									if max_product > largest:
												lowerCamelCase__	:	Tuple				=max_product

			return largest






def   snake_case__     (	):
			"""simple docstring"""
			lowerCamelCase__	:	Union[str, Any]				=[]
			with open(os.path.dirname(__lowerCamelCase			) + '''/grid.txt'''			) as file:
						for line in file:
									grid.append(line.strip('''\n'''			).split(''' '''			)			)

			lowerCamelCase__	:	Dict				=[[int(__lowerCamelCase			) for i in grid[j]] for j in range(len(__lowerCamelCase			)			)]

			return largest_product(__lowerCamelCase			)


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









"""simple docstring"""






def   snake_case__     (	__lowerCamelCase       :					str			):
			"""simple docstring"""
			return " ".join(
			    ''''''.join(word[::-1]			) if len(__lowerCamelCase			) > 4 else word for word in sentence.split()			)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		print(reverse_long_words("Hey wollef sroirraw"))




