



'''simple docstring'''




import os


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

				__SCREAMING_SNAKE_CASE       :		Tuple           =		0

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

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

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

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


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




'''simple docstring'''




def 				lowerCAmelCase_   (	_lowerCamelCase:   list					):
		if any(not isinstance(_lowerCamelCase       ,      _lowerCamelCase					) or x < 0 for x in sequence					):
				raise TypeError("""Sequence must be list of non-negative integers"""					)
		for _ in range(len(_lowerCamelCase					)					):
				for i, (rod_upper, rod_lower) in enumerate(zip(_lowerCamelCase       ,      sequence[1:]					)					):
						if rod_upper > rod_lower:
								sequence[i] -= rod_upper - rod_lower
								sequence[i + 1] += rod_upper - rod_lower
		return sequence


if __name__ == "__main__":
						assert bead_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]
						assert bead_sort([7, 9, 4, 3, 5]) == [3, 4, 5, 7, 9]