

'''simple docstring'''

import os




def       UpperCamelCase(     ):
 UpperCAmelCase       :	List[Any]											= os.path.dirname(os.path.realpath(SCREAMING_SNAKE_CASE__	)	)
 UpperCAmelCase       :	Tuple											= os.path.join(SCREAMING_SNAKE_CASE__  ,       'triangle.txt'	)

 with open(SCREAMING_SNAKE_CASE__	) as f:
  UpperCAmelCase       :	str											= f.readlines()

 UpperCAmelCase       :	Union[str, Any]											= []
 for line in triangle:
  UpperCAmelCase       :	Dict											= []
  for number in line.strip().split(' '	):
   numbers_from_line.append(int(SCREAMING_SNAKE_CASE__	)	)
  a.append(SCREAMING_SNAKE_CASE__	)

 for i in range(1  ,       len(SCREAMING_SNAKE_CASE__	)	):
  for j in range(len(a[i]	)	):
   UpperCAmelCase       :	Any											= a[i - 1][j] if j != len(a[i - 1]	) else 0
   UpperCAmelCase       :	int											= a[i - 1][j - 1] if j > 0 else 0
   a[i][j] += max(SCREAMING_SNAKE_CASE__  ,       SCREAMING_SNAKE_CASE__	)
 return max(a[-1]	)


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








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_A		       =						{
    'configuration_jukebox': [
        'JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'JukeboxConfig',
        'JukeboxPriorConfig',
        'JukeboxVQVAEConfig',
    ],
    'tokenization_jukebox': ['JukeboxTokenizer'],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A		       =						[
       'JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST',
       'JukeboxModel',
       'JukeboxPreTrainedModel',
       'JukeboxVQVAE',
       'JukeboxPrior',
   ]

if TYPE_CHECKING:
   from .configuration_jukebox import (
       JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP,
       JukeboxConfig,
       JukeboxPriorConfig,
       JukeboxVQVAEConfig,
   )
   from .tokenization_jukebox import JukeboxTokenizer

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_jukebox import (
          JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST,
          JukeboxModel,
          JukeboxPreTrainedModel,
          JukeboxPrior,
          JukeboxVQVAE,
      )

else:
   import sys

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





