import os


def 				A	( )       ->  List[str]:
		'''simple docstring'''

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

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

		UpperCamelCase          =					[]
		for line in triangle:
				UpperCamelCase          =					[]
				for number in line.strip().split(' '			):
						numbers_from_line.append(int(lowercase			)			)
				a.append(lowercase			)

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


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


from __future__ import annotations


def 				A	( lowercase   ,	lowercase			)       ->  tuple[int, int]:
		'''simple docstring'''

		if b == 0:
				return (1, 0)
		((UpperCamelCase)     ,  (UpperCamelCase))          =					extended_euclid(lowercase   ,	a % b			)
		UpperCamelCase          =					a // b
		return (y, x - k * y)


def 				A	( lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)       ->  int:
		'''simple docstring'''

		((UpperCamelCase)     ,  (UpperCamelCase))          =					extended_euclid(lowercase   ,	lowercase			)
		UpperCamelCase          =					na * na
		UpperCamelCase          =					ra * x * na + ra * y * na
		return (n % m + m) % m


def 				A	( lowercase   ,	lowercase			)       ->  int:
		'''simple docstring'''

		((UpperCamelCase)     ,  (UpperCamelCase))          =					extended_euclid(lowercase   ,	lowercase			)
		if b < 0:
				UpperCamelCase          =					(b % n + n) % n
		return b


def 				A	( lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)       ->  int:
		'''simple docstring'''

		UpperCamelCase     ,  UpperCamelCase          =					invert_modulo(lowercase   ,	lowercase			), invert_modulo(lowercase   ,	lowercase			)
		UpperCamelCase          =					na * na
		UpperCamelCase          =					ra * x * na + ra * y * na
		return (n % m + m) % m


if __name__ == "__main__":
					from doctest import testmod

					testmod(name="chinese_remainder_theorem", verbose=True)
					testmod(name="chinese_remainder_theorem2", verbose=True)
					testmod(name="invert_modulo", verbose=True)
					testmod(name="extended_euclid", verbose=True)
