
'''simple docstring'''



from __future__ import annotations


def A				(__lowerCamelCase				:list[int]		):
						_lowerCAmelCase  						=			len(__lowerCamelCase		) // 2

						# choose the middle 3 elements
						_lowerCAmelCase  						=			lst[m - 1 : m + 2]

						# if middle element is peak
						if three[1] > three[0] and three[1] > three[2]:
												return three[1]

						# if increasing, recurse on right
						elif three[0] < three[2]:
												if len(lst[:m]		) == 2:
																		m -= 1
												return peak(lst[m:]		)

						# decreasing
						else:
												if len(lst[:m]		) == 2:
																		m += 1
												return peak(lst[:m]		)


if __name__ == "__main__":
						import doctest

						doctest.testmod()


'''simple docstring'''



import os


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

												_lowerCAmelCase  						=			0

												# right
												for i in range(20		):
																		for j in range(17		):
																								_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(17		):
																		for j in range(20		):
																								_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(17		):
																		for j in range(17		):
																								_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(17		):
																		for j in range(3			,     20		):
																								_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())
