
"""simple docstring"""




import os

def __snake_case (      )       ->    List[Any]:


		"""simple docstring"""





		a__   		=     os.path.dirname(os.path.realpath(UpperCamelCase    )    )
		a__   		=     os.path.join(UpperCamelCase						,					'''triangle.txt'''    )

		with open(UpperCamelCase    ) as f:
				a__   		=     f.readlines()

		a__   		=     [[int(UpperCamelCase    ) for y in x.rstrip('''\r\n'''    ).split(''' '''    )] for x in triangle]

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


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






"""simple docstring"""




def __snake_case (      UpperCamelCase    )       ->    float:


		"""simple docstring"""





		return -num if num < 0 else num

def __snake_case (      UpperCamelCase    )       ->    int:


		"""simple docstring"""





		if len(UpperCamelCase    ) == 0:
				raise ValueError('''abs_min() arg is an empty sequence'''    )
		a__   		=     x[0]
		for i in x:
				if abs_val(UpperCamelCase    ) < abs_val(UpperCamelCase    ):
						a__   		=     i
		return j

def __snake_case (      UpperCamelCase    )       ->    int:


		"""simple docstring"""





		if len(UpperCamelCase    ) == 0:
				raise ValueError('''abs_max() arg is an empty sequence'''    )
		a__   		=     x[0]
		for i in x:
				if abs(UpperCamelCase    ) > abs(UpperCamelCase    ):
						a__   		=     i
		return j

def __snake_case (      UpperCamelCase    )       ->    int:


		"""simple docstring"""





		if len(UpperCamelCase    ) == 0:
				raise ValueError('''abs_max_sort() arg is an empty sequence'''    )
		return sorted(UpperCamelCase						,					key=UpperCamelCase    )[-1]

def __snake_case (      )       ->    Optional[int]:


		"""simple docstring"""





		assert abs_val(0    ) == 0
		assert abs_val(34    ) == 34
		assert abs_val(-100_000_000_000    ) == 100_000_000_000

		a__   		=     [-3, -1, 2, -11]
		assert abs_max(UpperCamelCase    ) == -11
		assert abs_max_sort(UpperCamelCase    ) == -11
		assert abs_min(UpperCamelCase    ) == -1


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					test_abs_val()
					print(abs_val(-34))  # --> 34




