





import os


def 				SCREAMING_SNAKE_CASE__    (     ):
	snake_case_		:      Dict           =						os.path.dirname(os.path.realpath(__a ) )
	snake_case_		:      Any           =						os.path.join(__a ,			'triangle.txt' )

	with open(__a ) as f:
		snake_case_		:      List[Any]           =						f.readlines()

	snake_case_		:      Union[str, 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] ) ):
			snake_case_		:      Dict           =						a[i - 1][j] if j != len(a[i - 1] ) else 0
			snake_case_		:      Dict           =						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())



"""simple docstring"""

def 						UpperCAmelCase   (						a_     ):





		'''simple docstring'''


		if not isinstance(a_,		a_     ):
				raise TypeError('recursive_lucas_number accepts only integer arguments.'     )
		if n_th_number == 0:
				return 2
		if n_th_number == 1:
				return 1

		return recursive_lucas_number(n_th_number - 1     ) + recursive_lucas_number(
		    n_th_number - 2     )
def 						UpperCAmelCase   (						a_     ):





		'''simple docstring'''


		if not isinstance(a_,		a_     ):
				raise TypeError('dynamic_lucas_number accepts only integer arguments.'     )
		lowerCamelCase      ,       lowerCamelCase	:     Optional[int]            =       2, 1
		for _ in range(a_     ):
				lowerCamelCase      ,       lowerCamelCase	:     Optional[int]            =       b, a + b
		return a


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

					testmod()
					_A				=					int(input('Enter the number of terms in lucas series:\n').strip())
					print('Using recursive function to calculate lucas series:')
					print(' '.join(str(recursive_lucas_number(i)) for i in range(n)))
					print('\nUsing dynamic function to calculate lucas series:')
					print(' '.join(str(dynamic_lucas_number(i)) for i in range(n)))






