



"""simple docstring"""

def       __magic_name__    (   _lowerCamelCase				: int					):

							if not isinstance(_lowerCamelCase  ,       _lowerCamelCase					):
														__a		:		List[Any]									=       F'''Input value of [number={number}] must be an integer'''
														raise TypeError(_lowerCamelCase					)

							if number < 1:
														__a		:		str									=       F'''Input value of [number={number}] must be > 0'''
														raise ValueError(_lowerCamelCase					)

							__a		:		Dict									=       1

							for i in range(1  ,       _lowerCamelCase					):
														current_number *= 4 * i - 2
														current_number //= i + 1

							return current_number


if __name__ == "__main__":
	import doctest

	doctest.testmod()






"""simple docstring"""

import os





def       __magic_name__    (   _lowerCamelCase				: Dict					):
							__a		:		List[str]									=       len(grid[0]					)
							__a		:		int									=       len(_lowerCamelCase					)

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

																					__a		:		str									=       max(
																					    _lowerCamelCase  ,       _lowerCamelCase  ,       _lowerCamelCase  ,       _lowerCamelCase					)
																					if max_product > largest:
																												__a		:		Optional[Any]									=       max_product

							return largest





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

							__a		:		Tuple									=       [[int(_lowerCamelCase					) for i in grid[j]] for j in range(len(_lowerCamelCase					)					)]

							return largest_product(_lowerCamelCase					)


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

