"""simple docstring"""






import os



def SCREAMING_SNAKE_CASE__			(   )  ->  int:
   with open(os.path.dirname(__UpperCAmelCase ) + '''/grid.txt''' ) as f:
      lowercase__:   Tuple					=      []  # noqa: E741
      for _ in range(2_0 ):
         l.append([int(__UpperCAmelCase ) for x in f.readline().split()] )

      lowercase__:   List[str]					=      0

      # right
      for i in range(2_0 ):
         for j in range(1_7 ):
            lowercase__:   Tuple					=      l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
            if temp > maximum:
               lowercase__:   Any					=      temp

        # down
      for i in range(1_7 ):
         for j in range(2_0 ):
            lowercase__:   Optional[Any]					=      l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
            if temp > maximum:
               lowercase__:   str					=      temp

        # diagonal 1
      for i in range(1_7 ):
         for j in range(1_7 ):
            lowercase__:   Optional[int]					=      l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
            if temp > maximum:
               lowercase__:   Union[str, Any]					=      temp

        # diagonal 2
      for i in range(1_7 ):
         for j in range(3       ,    2_0 ):
            lowercase__:   int					=      l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
            if temp > maximum:
               lowercase__:   Dict					=      temp
      return maximum


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

"""simple docstring"""






def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase )  ->  int:

   if not grid or not grid[0]:
      raise TypeError('''The grid does not contain the appropriate information''' )

   for cell_n in range(1       ,    len(grid[0] ) ):
      grid[0][cell_n] += grid[0][cell_n - 1]
   lowercase__:   Tuple					=      grid[0]

   for row_n in range(1       ,    len(__UpperCAmelCase ) ):
      lowercase__:   Tuple					=      grid[row_n]
      lowercase__:   Dict					=      fill_row(__UpperCAmelCase       ,    __UpperCAmelCase )
      lowercase__:   Union[str, Any]					=      grid[row_n]

   return grid[-1][-1]



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase       ,    __UpperCAmelCase )  ->  list:
   current_row[0] += row_above[0]
   for cell_n in range(1       ,    len(__UpperCAmelCase ) ):
      current_row[cell_n] += min(current_row[cell_n - 1]       ,    row_above[cell_n] )

   return current_row


if __name__ == "__main__":
       import doctest

       doctest.testmod()
