
'''simple docstring'''

from typing import Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_openai import OpenAIGPTTokenizer


UpperCamelCase_     			=       logging.get_logger(__name__)

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

UpperCamelCase_     			=       {
    """vocab_file""": {"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/vocab.json"""},
    """merges_file""": {"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/merges.txt"""},
    """tokenizer_file""": {"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/tokenizer.json"""},
}

UpperCamelCase_     			=       {
    """openai-gpt""": 5_12,
}


class   a_  (_a    ):
       __lowerCAmelCase    :				str    =      VOCAB_FILES_NAMES
       __lowerCAmelCase    :				Optional[int]    =      PRETRAINED_VOCAB_FILES_MAP
       __lowerCAmelCase    :				Dict    =      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       __lowerCAmelCase    :				int    =      ["""input_ids""", """attention_mask"""]
       __lowerCAmelCase    :				Optional[int]    =      OpenAIGPTTokenizer




       def __init__(     self   ,   snake_case_=None   ,   snake_case_=None   ,   snake_case_=None   ,   snake_case_="<unk>"   ,   **snake_case_  ):
         super().__init__(snake_case_   ,   snake_case_   ,   tokenizer_file=snake_case_   ,   unk_token=snake_case_   ,   **snake_case_  )




       @property
       def 							__UpperCamelCase       (     self  ):
         return True







       def 							__UpperCamelCase       (     self   ,   snake_case_   ,   snake_case_ = None  ):
         _lowerCAmelCase       :  int   				=					self._tokenizer.model.save(snake_case_   ,   name=snake_case_  )
         return tuple(snake_case_  )




'''simple docstring'''

import os


def 	_UpperCAmelCase				(  )    ->						int:
  _lowerCAmelCase       :  Optional[int]   				=					os.path.dirname(os.path.realpath(_lowerCamelCase		)		)
  _lowerCAmelCase       :  Optional[Any]   				=					os.path.join(_lowerCamelCase  ,      """triangle.txt"""		)

  with open(_lowerCamelCase		) as in_file:
    _lowerCAmelCase       :  List[Any]   				=					[[int(_lowerCamelCase		) for i in line.split()] for line in in_file]

  while len(_lowerCamelCase		) != 1:
    _lowerCAmelCase       :  Any   				=					triangle.pop()
    _lowerCAmelCase       :  List[str]   				=					triangle[-1]
    for j in range(len(_lowerCamelCase		) - 1		):
      curr_row[j] += max(last_row[j]  ,      last_row[j + 1]		)
  return triangle[0][0]


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


