





'''simple docstring'''







import os





def        lowerCamelCase_      (  ) ->	str:
						with open(os.path.dirname(SCREAMING_SNAKE_CASE__   ) + '''/grid.txt'''   ) as f:
												UpperCAmelCase_			:      Tuple     						=  []  # noqa: E741
												for _ in range(20   ):
																		l.append([int(SCREAMING_SNAKE_CASE__   ) for x in f.readline().split()]   )

												UpperCAmelCase_			:      Optional[Any]     						=  0

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

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

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

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


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












'''simple docstring'''







def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			list[int]   ) ->	list[list[int]]:
						UpperCAmelCase_			:      int     						=  []
						if len(SCREAMING_SNAKE_CASE__   ) == 1:
												return [nums.copy()]
						for _ in range(len(SCREAMING_SNAKE_CASE__   )   ):
												UpperCAmelCase_			:      List[Any]     						=  nums.pop(0   )
												UpperCAmelCase_			:      Optional[Any]     						=  permute(SCREAMING_SNAKE_CASE__   )
												for perm in permutations:
																		perm.append(SCREAMING_SNAKE_CASE__   )
												result.extend(SCREAMING_SNAKE_CASE__   )
												nums.append(SCREAMING_SNAKE_CASE__   )
						return result





def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			List[str]   ) ->	Any:

						def backtrack(SCREAMING_SNAKE_CASE__      :			Union[str, Any]   ):
												if start == len(SCREAMING_SNAKE_CASE__   ) - 1:
																		output.append(nums[:]   )
												else:
																		for i in range(SCREAMING_SNAKE_CASE__,			len(SCREAMING_SNAKE_CASE__   )   ):
																								UpperCAmelCase_						,       UpperCAmelCase_			:      Tuple     						=  nums[i], nums[start]
																								backtrack(start + 1   )
																								UpperCAmelCase_						,       UpperCAmelCase_			:      int     						=  nums[i], nums[start]  # backtrack

						UpperCAmelCase_			:      Optional[int]     						=  []
						backtrack(0   )
						return output


if __name__ == "__main__":
					import doctest

					# use res to print the data in permute2 function
					snake_case_     :       Tuple						=  permutea([1, 2, 3])
					print(res)
					doctest.testmod()





