




'''simple docstring'''







import os






def 		_lowercase		(	):



		'''simple docstring'''







		_snake_case	       =       os.path.dirname(os.path.realpath(lowercase_  )  )
		_snake_case	       =       os.path.join(lowercase_						,							"triangle.txt"  )

		with open(lowercase_  ) as f:
				_snake_case	       =       f.readlines()

		_snake_case	       =       [[int(lowercase_  ) for y in x.rstrip("\r\n"  ).split(" "  )] for x in triangle]

		for i in range(1						,							len(lowercase_  )  ):
				for j in range(len(a[i]  )  ):
						_snake_case	       =       a[i - 1][j] if j != len(a[i - 1]  ) else 0
						_snake_case	       =       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())











'''simple docstring'''







from functools import lru_cache






@lru_cache
def 		_lowercase		(	lowercase_  ):



		'''simple docstring'''







		if not isinstance(lowercase_						,							lowercase_  ):
				raise TypeError("k must be an integer."  )
		if k < 0:
				raise ValueError("k integer must be greater or equal to zero."  )
		if k == 0:
				return 0
		elif k == 1:
				return 1
		else:
				return fibonacci(k - 1  ) + fibonacci(k - 2  )






def 		_lowercase		(	lowercase_						,							lowercase_  ):



		'''simple docstring'''







		_snake_case	       =       len(lowercase_  )
		# Find m such that F_m >= n where F_i is the i_th fibonacci number.
		_snake_case	       =       0
		while True:
				if fibonacci(lowercase_  ) >= len_list:
						_snake_case	       =       i
						break
				i += 1
		_snake_case	       =       0
		while fibb_k > 0:
				_snake_case	       =       min(
				    offset + fibonacci(fibb_k - 1  )						,							len_list - 1  )  # Prevent out of range
				_snake_case	       =       arr[index_k]
				if item_k_1 == val:
						return index_k
				elif val < item_k_1:
						fibb_k -= 1
				elif val > item_k_1:
						offset += fibonacci(fibb_k - 1  )
						fibb_k -= 2
		else:
				return -1


if __name__ == "__main__":
						import doctest

						doctest.testmod()





