



"""simple docstring"""







import os


def  __SCREAMING_SNAKE_CASE (  ):
		_lowercase				: str     =   os.path.dirname(os.path.realpath(__UpperCAmelCase      )      )
		_lowercase				: str     =   os.path.join(__UpperCAmelCase   ,				"""triangle.txt"""      )

		with open(__UpperCAmelCase      ) as in_file:
				_lowercase				: List[str]     =   [[int(__UpperCAmelCase      ) for i in line.split()] for line in in_file]

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


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








def 						_lowerCAmelCase    (					__lowerCamelCase :  list  ):



 """simple docstring"""





 if len(__lowerCamelCase  ) <= 1:
  return data
 else:
  return [
      *quick_sort([e for e in data[1:] if e <= data[0]]  ),
      data[0],
      *quick_sort([e for e in data[1:] if e > data[0]]  ),
  ]


if __name__ == "__main__":
      import doctest

      doctest.testmod()






