





import os


def 				SCREAMING_SNAKE_CASE__    (     ):
	snake_case_		:      Dict           =						os.path.dirname(os.path.realpath(__a ) )
	snake_case_		:      Any           =						os.path.join(__a ,			'triangle.txt' )

	with open(__a ) as f:
		snake_case_		:      List[Any]           =						f.readlines()

	snake_case_		:      Union[str, Any]           =						[[int(__a ) for y in x.rstrip('\r\n' ).split(' ' )] for x in triangle]

	for i in range(1 ,			len(__a ) ):
		for j in range(len(a[i] ) ):
			snake_case_		:      Dict           =						a[i - 1][j] if j != len(a[i - 1] ) else 0
			snake_case_		:      Dict           =						a[i - 1][j - 1] if j > 0 else 0
			a[i][j] += max(__a ,			__a )
	return max(a[-1] )


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


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase    				=		{'''configuration_dinat''': ['''DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''DinatConfig''']}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase    				=		[
          '''DINAT_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''DinatForImageClassification''',
          '''DinatModel''',
          '''DinatPreTrainedModel''',
          '''DinatBackbone''',
      ]

if TYPE_CHECKING:
      from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_dinat import (
                DINAT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DinatBackbone,
                DinatForImageClassification,
                DinatModel,
                DinatPreTrainedModel,
            )

else:
      import sys

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



