import os

def    SCREAMING_SNAKE_CASE_     (						)     ->	List[str]:
							with open(os.path.dirname(A__							) + '''/grid.txt'''							) as f:
														lowerCAmelCase			=		[]  # noqa: E741
														for _ in range(2_0							):
																					l.append([int(A__							) for x in f.readline().split()]							)

														lowerCAmelCase			=		0

														# right
														for i in range(2_0							):
																					for j in range(1_7							):
																												lowerCAmelCase			=		l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																												if temp > maximum:
																																			lowerCAmelCase			=		temp

        # down
														for i in range(1_7							):
																					for j in range(2_0							):
																												lowerCAmelCase			=		l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																												if temp > maximum:
																																			lowerCAmelCase			=		temp

        # diagonal 1
														for i in range(1_7							):
																					for j in range(1_7							):
																												lowerCAmelCase			=		l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																												if temp > maximum:
																																			lowerCAmelCase			=		temp

        # diagonal 2
														for i in range(1_7							):
																					for j in range(3   ,  2_0							):
																												lowerCAmelCase			=		l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																												if temp > maximum:
																																			lowerCAmelCase			=		temp
														return maximum


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











"""simple docstring"""
def 				snake_case      (   A__	,A__	,A__	,A__	,A__						):
			if index == number_of_items:
						return 0
			UpperCAmelCase_     : str			     =					0
			UpperCAmelCase_     : Dict			     =					0
			UpperCAmelCase_     : Tuple			     =					knapsack(A__	,A__	,A__	,A__	,index + 1						)
			if weights[index] <= max_weight:
						UpperCAmelCase_     : Union[str, Any]			     =					values[index] + knapsack(
						    A__	,A__	,A__	,max_weight - weights[index]	,index + 1						)
			return max(A__	,A__						)


if __name__ == "__main__":
			import doctest

			doctest.testmod()



