






import os
def       snake_case_		(     ):
							with open(os.path.dirname(lowerCAmelCase_      ) + """/grid.txt"""      ) as f:
														__lowercase      :							Dict				=     []  # noqa: E741
														for _ in range(20      ):
																					l.append([int(lowerCAmelCase_      ) for x in f.readline().split()]      )

														__lowercase      :							Optional[Any]				=     0

														# right
														for i in range(20      ):
																					for j in range(17      ):
																												__lowercase      :							Union[str, Any]				=     l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																												if temp > maximum:
																																			__lowercase      :							Optional[int]				=     temp

        # down
														for i in range(17      ):
																					for j in range(20      ):
																												__lowercase      :							Optional[int]				=     l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																												if temp > maximum:
																																			__lowercase      :							List[Any]				=     temp

        # diagonal 1
														for i in range(17      ):
																					for j in range(17      ):
																												__lowercase      :							Tuple				=     l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																												if temp > maximum:
																																			__lowercase      :							Optional[Any]				=     temp

        # diagonal 2
														for i in range(17      ):
																					for j in range(3       ,       20      ):
																												__lowercase      :							Tuple				=     l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																												if temp > maximum:
																																			__lowercase      :							int				=     temp
														return maximum


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







from __future__ import annotations
def       snake_case_		(     lowerCAmelCase_       :						list[int]      ):
							if not nums:
														return 0
							__lowercase      :							Tuple				=     nums[0]
							__lowercase      :							Tuple				=     0
							for num in nums[1:]:
														__lowercase			,			__lowercase      :							List[str]				=     (
														    max_excluding + num,
														    max(lowerCAmelCase_       ,       lowerCAmelCase_      ),
														)
							return max(lowerCAmelCase_       ,       lowerCAmelCase_      )


if __name__ == "__main__":
	import doctest

	doctest.testmod()