




'''simple docstring'''



import os







def       _UpperCamelCase			()-> List[Any]:




     '''simple docstring'''





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

          __snake_case            =	0

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

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

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

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


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












'''simple docstring'''



from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader





class      lowerCAmelCase (			__lowerCAmelCase):


       def __init__( self     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE = None     ,	__SCREAMING_SNAKE_CASE = None     ,	__SCREAMING_SNAKE_CASE = True     ,	__SCREAMING_SNAKE_CASE = None     ,	__SCREAMING_SNAKE_CASE = False     ,	__SCREAMING_SNAKE_CASE = None     ,	__SCREAMING_SNAKE_CASE = True     ,	__SCREAMING_SNAKE_CASE = "arrow"     ,	**__SCREAMING_SNAKE_CASE     ,	)   ->	Union[str, Any]:



            '''simple docstring'''




            super().__init__(
                split=__SCREAMING_SNAKE_CASE     ,	features=__SCREAMING_SNAKE_CASE     ,	cache_dir=__SCREAMING_SNAKE_CASE     ,	keep_in_memory=__SCREAMING_SNAKE_CASE     ,	streaming=__SCREAMING_SNAKE_CASE     ,	**__SCREAMING_SNAKE_CASE     ,	)
            __snake_case            =	load_from_cache_file
            __snake_case            =	file_format
            __snake_case            =	Spark(
                df=__SCREAMING_SNAKE_CASE     ,	features=__SCREAMING_SNAKE_CASE     ,	cache_dir=__SCREAMING_SNAKE_CASE     ,	working_dir=__SCREAMING_SNAKE_CASE     ,	**__SCREAMING_SNAKE_CASE     ,	)




       def    lowerCAmelCase   ( self	)   ->	str:



            '''simple docstring'''




            if self.streaming:
                 return self.builder.as_streaming_dataset(split=self.split	)
            __snake_case            =	None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
            self.builder.download_and_prepare(
                download_mode=__SCREAMING_SNAKE_CASE     ,	file_format=self._file_format     ,	)
            return self.builder.as_dataset(split=self.split	)






