

import os


def 				_UpperCAmelCase							(	):

			'''simple docstring'''



			a_	:	Dict          =   os.path.dirname(os.path.realpath(a__))
			a_	:	Optional[int]          =   os.path.join(a__     ,  """triangle.txt""")

			with open(a__) as f:
						a_	:	Tuple          =   f.readlines()

			a_	:	Optional[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])):
									a_	:	Union[str, Any]          =   a[i - 1][j] if j != len(a[i - 1]) else 0
									a_	:	List[Any]          =   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 dataclasses import dataclass
from typing import Callable, Optional

import datasets



@dataclass
class 					A__(datasets.BuilderConfig       ):
						"""simple docstring"""






						_A						:							Optional[Callable]									= None
						_A						:							Optional[dict]									= None
						_A						:							Optional[datasets.Features]									= None





						def  UpperCamelCase__				(						self						)    ->   Tuple:
									assert self.generator is not None, "generator must be specified"

									if self.gen_kwargs is None:
												a_	:	Tuple          =   {}







class 					A__(datasets.GeneratorBasedBuilder       ):
						"""simple docstring"""






						_A						:							Dict									= GeneratorConfig





						def  UpperCamelCase__				(						self						)    ->   List[Any]:
									return datasets.DatasetInfo(features=self.config.features						)





						def  UpperCamelCase__				(						self     ,			_lowercase						)    ->   List[Any]:
									return [datasets.SplitGenerator(name=datasets.Split.TRAIN     ,			gen_kwargs=self.config.gen_kwargs						)]





						def  UpperCamelCase__				(						self     ,			**_lowercase						)    ->   Tuple:
									for idx, ex in enumerate(self.config.generator(**_lowercase						)						):
												yield idx, ex


