

import os
def        UpperCAmelCase_     (		):





     '''simple docstring'''




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

          SCREAMING_SNAKE_CASE__					=					0

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

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

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

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


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





from __future__ import annotations

import collections
import pprint
from pathlib import Path
def        UpperCAmelCase_     (		_A       ):





     '''simple docstring'''




     return "".join(sorted(_A       )       )
def        UpperCAmelCase_     (		_A       ):





     '''simple docstring'''




     return word_by_signature[signature(_A       )]


_SCREAMING_SNAKE_CASE  :						str         =    Path(__file__).parent.joinpath('''words.txt''').read_text(encoding='''utf-8''')
_SCREAMING_SNAKE_CASE  :						str         =    sorted({word.strip().lower() for word in data.splitlines()})

_SCREAMING_SNAKE_CASE  :						List[Any]         =    collections.defaultdict(list)
for word in word_list:
       word_by_signature[signature(word)].append(word)

if __name__ == "__main__":
       _SCREAMING_SNAKE_CASE  :						Tuple         =    {word: anagram(word) for word in word_list if len(anagram(word)) > 1}

       with open('''anagrams.txt''', '''w''') as file:
              file.write('''all_anagrams = \n ''')
              file.write(pprint.pformat(all_anagrams))


