



'''simple docstring'''

from typing import List, Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_herbert import HerbertTokenizer


UpperCAmelCase      						=       logging.get_logger(__name__)

UpperCAmelCase      						=       {"""vocab_file""": """vocab.json""", """merges_file""": """merges.txt""", """tokenizer_file""": """tokenizer.json"""}

UpperCAmelCase      						=       {
    """vocab_file""": {
        """allegro/herbert-base-cased""": """https://huggingface.co/allegro/herbert-base-cased/resolve/main/vocab.json"""
    },
    """merges_file""": {
        """allegro/herbert-base-cased""": """https://huggingface.co/allegro/herbert-base-cased/resolve/main/merges.txt"""
    },
}

UpperCAmelCase      						=       {"""allegro/herbert-base-cased""": 514}
UpperCAmelCase      						=       {}

class __snake_case( __snake_case   ):


						'''simple docstring'''



						UpperCAmelCase				:       Tuple 	=						VOCAB_FILES_NAMES
						UpperCAmelCase				:       Union[str, Any] 	=						PRETRAINED_VOCAB_FILES_MAP
						UpperCAmelCase				:       str 	=						PRETRAINED_INIT_CONFIGURATION
						UpperCAmelCase				:       Any 	=						PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
						UpperCAmelCase				:       Union[str, Any] 	=						HerbertTokenizer


						def __init__(   self      ,			A_=None      ,			A_=None      ,			A_=None      ,			A_="<s>"      ,			A_="<unk>"      ,			A_="<pad>"      ,			A_="<mask>"      ,			A_="</s>"      ,			**A_      ,			)      ->      str:
							super().__init__(
							    A_      ,			A_      ,			tokenizer_file=A_      ,			cls_token=A_      ,			unk_token=A_      ,			pad_token=A_      ,			mask_token=A_      ,			sep_token=A_      ,			**A_      ,			)


						def 							__snake_case       (   self      ,			A_      ,			A_ = None )      ->      Optional[Any]:
							lowerCAmelCase       =      [self.cls_token_id]
							lowerCAmelCase       =      [self.sep_token_id]
							if token_ids_a is None:
								return cls + token_ids_a + sep

							return cls + token_ids_a + sep + token_ids_a + sep


						def 							__snake_case       (   self      ,			A_      ,			A_ = None      ,			A_ = False )      ->      Optional[int]:




							if already_has_special_tokens:
								return super().get_special_tokens_mask(
								    token_ids_a=A_      ,			token_ids_a=A_      ,			already_has_special_tokens=A_ )

							if token_ids_a is None:
								return [1] + ([0] * len(A_ )) + [1]
							return [1] + ([0] * len(A_ )) + [1] + ([0] * len(A_ )) + [1]


						def 							__snake_case       (   self      ,			A_      ,			A_ = None )      ->      Optional[int]:
							lowerCAmelCase       =      [self.sep_token_id]
							lowerCAmelCase       =      [self.cls_token_id]

							if token_ids_a is None:
								return len(cls + token_ids_a + sep ) * [0]
							return len(cls + token_ids_a + sep ) * [0] + len(token_ids_a + sep ) * [1]




						def 							__snake_case       (   self      ,			A_      ,			A_ = None )      ->      Optional[int]:
							lowerCAmelCase       =      self._tokenizer.model.save(A_      ,			name=A_ )
							return tuple(A_ )






import os



def 						A_							(	)		->					Union[str, Any]:
 with open(os.path.dirname(_lowerCAmelCase	) + "/grid.txt"	) as f:
  UpperCamelCase      :   Optional[Any]			      =  []  # noqa: E741
  for _ in range(20	):
   l.append([int(_lowerCAmelCase	) for x in f.readline().split()]	)

  UpperCamelCase      :   str			      =  0

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

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

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

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


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