
'''simple docstring'''



from __future__ import annotations

_lowercase    =		"""#"""




class   UpperCAmelCase_					:






						'''simple docstring'''






						def __init__( self				):

												"""simple docstring"""



												_lowerCAmelCase  						=			{}




						def  _lowercase     ( self   ,       _lowercase				):

												"""simple docstring"""



												_lowerCAmelCase  						=			self._trie
												for char in text:
																		if char not in trie:
																								_lowerCAmelCase  						=			{}
																		_lowerCAmelCase  						=			trie[char]
												_lowerCAmelCase  						=			True




						def  _lowercase     ( self   ,       _lowercase				):

												"""simple docstring"""



												_lowerCAmelCase  						=			self._trie
												for char in prefix:
																		if char in trie:
																								_lowerCAmelCase  						=			trie[char]
																		else:
																								return []
												return self._elements(_lowercase				)




						def  _lowercase     ( self   ,       _lowercase				):

												"""simple docstring"""



												_lowerCAmelCase  						=			[]
												for c, v in d.items():
																		_lowerCAmelCase  						=			[""" """] if c == END else [(c + s) for s in self._elements(_lowercase				)]
																		result.extend(_lowercase				)
												return tuple(_lowercase				)






_lowercase    =		Trie()
_lowercase    =		("""depart""", """detergent""", """daring""", """dog""", """deer""", """deal""")
for word in words:
						trie.insert_word(word)


def A				(__lowerCamelCase				:str		):
						_lowerCAmelCase  						=			trie.find_word(__lowerCamelCase		)
						return tuple(string + word for word in suffixes		)


def A				():
						print(autocomplete_using_trie("""de"""		)		)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()


'''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())
