
'''simple docstring'''

import os






def 	_snake_case						(      A_       :    Dict   ):
  """simple docstring"""







  a_      :	List[str]      =							len(grid[0]   )
  a_      :	int      =							len(_lowerCamelCase   )

  a_      :	Tuple      =							0
  a_      :	List[Any]      =							0
  a_      :	List[str]      =							0

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

      a_      :	str      =							max(
          _lowerCamelCase     ,		_lowerCamelCase     ,		_lowerCamelCase     ,		_lowerCamelCase   )
      if max_product > largest:
        a_      :	Optional[Any]      =							max_product

  return largest






def 	_snake_case						(      ):
  """simple docstring"""







  a_      :	Tuple      =							[]
  with open(os.path.dirname(_lowerCamelCase   ) + """/grid.txt"""   ) as file:
    for line in file:
      grid.append(line.strip("""\n"""   ).split(""" """   )   )

  a_      :	Tuple      =							[[int(_lowerCamelCase   ) for i in grid[j]] for j in range(len(_lowerCamelCase   )   )]

  return largest_product(_lowerCamelCase   )


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


'''simple docstring'''

from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxSeqaSeqConfigWithPast
from ...utils import logging


__snake_case:  Tuple								=			logging.get_logger(__name__)

__snake_case:  Tuple								=			{
    "t5-small": "https://huggingface.co/t5-small/resolve/main/config.json",
    "t5-base": "https://huggingface.co/t5-base/resolve/main/config.json",
    "t5-large": "https://huggingface.co/t5-large/resolve/main/config.json",
    "t5-3b": "https://huggingface.co/t5-3b/resolve/main/config.json",
    "t5-11b": "https://huggingface.co/t5-11b/resolve/main/config.json",
}


class  _UpperCAmelCase ( lowerCAmelCase__    ):

     """simple docstring"""

     a_    	=					"t5"
     a_    	=					["past_key_values"]
     a_    	=					{"hidden_size": "d_model", "num_attention_heads": "num_heads", "num_hidden_layers": "num_layers"}


     def __init__(      self							,		lowerCAmelCase_=3_21_28							,		lowerCAmelCase_=5_12							,		lowerCAmelCase_=64							,		lowerCAmelCase_=20_48							,		lowerCAmelCase_=6							,		lowerCAmelCase_=None							,		lowerCAmelCase_=8							,		lowerCAmelCase_=32							,		lowerCAmelCase_=1_28							,		lowerCAmelCase_=0.1							,		lowerCAmelCase_=1E-6							,		lowerCAmelCase_=1.0							,		lowerCAmelCase_="relu"							,		lowerCAmelCase_=True							,		lowerCAmelCase_=True							,		lowerCAmelCase_=0							,		lowerCAmelCase_=1							,		**lowerCAmelCase_							,		):

       '''simple docstring'''

       a_      :	List[Any]      =							vocab_size
       a_      :	List[str]      =							d_model
       a_      :	Union[str, Any]      =							d_kv
       a_      :	List[Any]      =							d_ff
       a_      :	int      =							num_layers
       a_      :	Any      =							(
           num_decoder_layers if num_decoder_layers is not None else self.num_layers
       )  # default = symmetry
       a_      :	Union[str, Any]      =							num_heads
       a_      :	int      =							relative_attention_num_buckets
       a_      :	Dict      =							relative_attention_max_distance
       a_      :	Union[str, Any]      =							dropout_rate
       a_      :	Union[str, Any]      =							layer_norm_epsilon
       a_      :	List[Any]      =							initializer_factor
       a_      :	Any      =							feed_forward_proj
       a_      :	List[Any]      =							use_cache

       a_      :	Dict      =							self.feed_forward_proj.split("""-""" )
       a_      :	Union[str, Any]      =							act_info[-1]
       a_      :	str      =							act_info[0] == """gated"""

       if len(lowerCAmelCase_ ) > 1 and act_info[0] != "gated" or len(lowerCAmelCase_ ) > 2:
         raise ValueError(
             f'''`feed_forward_proj`: {feed_forward_proj} is not a valid activation function of the dense layer.'''
             """Please make sure `feed_forward_proj` is of the format `gated-{ACT_FN}` or `{ACT_FN}`, e.g. """
             """'gated-gelu' or 'relu'""" )

       # for backwards compatibility
       if feed_forward_proj == "gated-gelu":
         a_      :	List[str]      =							"""gelu_new"""

       super().__init__(
           pad_token_id=lowerCAmelCase_							,		eos_token_id=lowerCAmelCase_							,		is_encoder_decoder=lowerCAmelCase_							,		**lowerCAmelCase_							,		)







class  _UpperCAmelCase ( lowerCAmelCase__    ):

     """simple docstring"""

     @property
     def 							_lowerCAmelCase  (      self ):

       '''simple docstring'''

       a_      :	List[Any]      =							{
           """input_ids""": {0: """batch""", 1: """encoder_sequence"""},
           """attention_mask""": {0: """batch""", 1: """encoder_sequence"""},
       }
       if self.use_past:
         a_      :	Tuple      =							"""past_encoder_sequence + sequence"""
         a_      :	str      =							{0: """batch"""}
         a_      :	Any      =							{0: """batch""", 1: """past_decoder_sequence + sequence"""}
       else:
         a_      :	List[Any]      =							{0: """batch""", 1: """decoder_sequence"""}
         a_      :	Optional[int]      =							{0: """batch""", 1: """decoder_sequence"""}

       if self.use_past:
         self.fill_with_past_key_values_(lowerCAmelCase_							,		direction="""inputs""" )

       return common_inputs






     @property
     def 							_lowerCAmelCase  (      self ):

       '''simple docstring'''

       return 13


