

'''simple docstring'''







import os
def  UpperCAmelCase__      ( UpperCAmelCase__			)     ->     Any:
       A_		   = len(grid[0]			)
       A_		   = len(UpperCAmelCase__			)

       A_		   = 0
       A_		   = 0
       A_		   = 0

       # Check vertically, horizontally, diagonally at the same time (only works
       # for nxn grid)
       for i in range(UpperCAmelCase__			):
              for j in range(n_rows - 3			):
                     A_		   = grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
                     A_		   = grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

                     # Left-to-right diagonal (\) product
                     if i < n_columns - 3:
                            A_		   = (
                                grid[i][j]
                                * grid[i + 1][j + 1]
                                * grid[i + 2][j + 2]
                                * grid[i + 3][j + 3]
                            )

                     # Right-to-left diagonal(/) product
                     if i > 2:
                            A_		   = (
                                grid[i][j]
                                * grid[i - 1][j + 1]
                                * grid[i - 2][j + 2]
                                * grid[i - 3][j + 3]
                            )

                     A_		   = max(
                         UpperCAmelCase__,    UpperCAmelCase__,    UpperCAmelCase__,    UpperCAmelCase__			)
                     if max_product > largest:
                            A_		   = max_product

       return largest
def  UpperCAmelCase__      ( )     ->     List[str]:
       A_		   = []
       with open(os.path.dirname(UpperCAmelCase__			) + """/grid.txt"""			) as file:
              for line in file:
                     grid.append(line.strip("""\n"""			).split(""" """			)			)

       A_		   = [[int(UpperCAmelCase__			) for i in grid[j]] for j in range(len(UpperCAmelCase__			)			)]

       return largest_product(UpperCAmelCase__			)


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



'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__lowerCamelCase						    =      {
    '''configuration_blenderbot''': [
        '''BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''BlenderbotConfig''',
        '''BlenderbotOnnxConfig''',
    ],
    '''tokenization_blenderbot''': ['''BlenderbotTokenizer'''],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase						    =      ['''BlenderbotTokenizerFast''']

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase						    =      [
          '''BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''BlenderbotForCausalLM''',
          '''BlenderbotForConditionalGeneration''',
          '''BlenderbotModel''',
          '''BlenderbotPreTrainedModel''',
      ]


try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase						    =      [
          '''TFBlenderbotForConditionalGeneration''',
          '''TFBlenderbotModel''',
          '''TFBlenderbotPreTrainedModel''',
      ]


try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase						    =      [
          '''FlaxBlenderbotForConditionalGeneration''',
          '''FlaxBlenderbotModel''',
          '''FlaxBlenderbotPreTrainedModel''',
      ]


if TYPE_CHECKING:
      from .configuration_blenderbot import (
          BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP,
          BlenderbotConfig,
          BlenderbotOnnxConfig,
      )
      from .tokenization_blenderbot import BlenderbotTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_blenderbot_fast import BlenderbotTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_blenderbot import (
                BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST,
                BlenderbotForCausalLM,
                BlenderbotForConditionalGeneration,
                BlenderbotModel,
                BlenderbotPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_blenderbot import (
                TFBlenderbotForConditionalGeneration,
                TFBlenderbotModel,
                TFBlenderbotPreTrainedModel,
            )

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_blenderbot import (
                FlaxBlenderbotForConditionalGeneration,
                FlaxBlenderbotModel,
                FlaxBlenderbotPreTrainedModel,
            )

else:
      import sys

      __lowerCamelCase						    =      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
