


'''simple docstring'''

import re

from filelock import FileLock


try:
	import nltk

	_UpperCAmelCase :       str										= True
except (ImportError, ModuleNotFoundError):
	_UpperCAmelCase :       Union[str, Any]										= False

if NLTK_AVAILABLE:
	with FileLock(""".lock""") as lock:
		nltk.download("""punkt""", quiet=True)

def 							__magic_name__(  lowerCamelCase):
						re.sub('''<n>''', '''''', A__)  # remove pegasus newline char
						assert NLTK_AVAILABLE, "nltk must be installed to separate newlines between sentences. (pip install nltk)"
						return "\n".join(nltk.sent_tokenize(A__))









"""simple docstring"""
import os

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

						UpperCAmelCase_     : Any			     =					0

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

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

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

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


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



