
'''simple docstring'''







import os





def 					UpperCAmelCase_		(__a      :    List[str] ):






   """simple docstring"""

   _a				:	Dict			=   len(grid[0] )
   _a				:	Dict			=   len(__a )

   _a				:	Dict			=   0
   _a				:	Optional[int]			=   0
   _a				:	Any			=   0

   # Check vertically, horizontally, diagonally at the same time (only works
   # for nxn grid)
   for i in range(__a ):
      for j in range(n_rows - 3 ):
         _a				:	int			=   grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
         _a				:	Any			=   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				:	Union[str, Any]			=   (
                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				:	Tuple			=   (
                grid[i][j]
                * grid[i - 1][j + 1]
                * grid[i - 2][j + 2]
                * grid[i - 3][j + 3]
            )

         _a				:	Union[str, Any]			=   max(
             __a ,	__a ,	__a ,	__a )
         if max_product > largest:
            _a				:	Any			=   max_product

   return largest





def 					UpperCAmelCase_		():






   """simple docstring"""

   _a				:	Any			=   []
   with open(os.path.dirname(__a ) + '/grid.txt' ) as file:
      for line in file:
         grid.append(line.strip('\n' ).split(' ' ) )

   _a				:	Any			=   [[int(__a ) for i in grid[j]] for j in range(len(__a ) )]

   return largest_product(__a )


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





'''simple docstring'''







import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


__lowerCAmelCase         =    HUGGINGFACE_HUB_CACHE


__lowerCAmelCase         =    """config.json"""
__lowerCAmelCase         =    """diffusion_pytorch_model.bin"""
__lowerCAmelCase         =    """diffusion_flax_model.msgpack"""
__lowerCAmelCase         =    """model.onnx"""
__lowerCAmelCase         =    """diffusion_pytorch_model.safetensors"""
__lowerCAmelCase         =    """weights.pb"""
__lowerCAmelCase         =    """https://huggingface.co"""
__lowerCAmelCase         =    default_cache_path
__lowerCAmelCase         =    """diffusers_modules"""
__lowerCAmelCase         =    os.getenv("""HF_MODULES_CACHE""", os.path.join(hf_cache_home, """modules"""))
__lowerCAmelCase         =    ["""fp16""", """non-ema"""]
__lowerCAmelCase         =    """.self_attn"""



