



"""simple docstring"""
import sys

sys.set_int_max_str_digits(0)  # type: ignore
def   A_    (     _lowercase      ):







						'''simple docstring'''


						snake_case_					:str		=     [0] * 11
						snake_case_					:Optional[Any]		=     [0] * 11

						# mark last 9 numbers
						for _ in range(9      ):
												snake_case_					:Dict		=     1
												snake_case_					:Optional[Any]		=     number // 10
						# flag
						snake_case_					:Tuple		=     True

						# check last 9 numbers for pandigitality

						for x in range(9      ):
												if not check_last[x + 1]:
																		snake_case_					:Optional[int]		=     False
						if not f:
												return f

						# mark first 9 numbers
						snake_case_					:Optional[int]		=     int(str(_lowercase      )[:9]      )

						for _ in range(9      ):
												snake_case_					:List[Any]		=     1
												snake_case_					:List[Any]		=     number // 10

						# check first 9 numbers for pandigitality

						for x in range(9      ):
												if not check_front[x + 1]:
																		snake_case_					:Union[str, Any]		=     False
						return f
def   A_    (     _lowercase      ):







						'''simple docstring'''


						snake_case_					:Optional[Any]		=     [0] * 11

						# mark last 9 numbers
						for _ in range(9      ):
												snake_case_					:Optional[Any]		=     1
												snake_case_					:str		=     number // 10
						# flag
						snake_case_					:List[str]		=     True

						# check last 9 numbers for pandigitality

						for x in range(9      ):
												if not check_last[x + 1]:
																		snake_case_					:List[str]		=     False
						return f
def   A_    (     ):







						'''simple docstring'''


						snake_case_					:Optional[int]		=     1
						snake_case_					:List[str]		=     1
						snake_case_					:Dict		=     2
						# temporary Fibonacci numbers

						snake_case_					:List[str]		=     1
						snake_case_					:Any		=     1
						snake_case_					:List[str]		=     2
						# temporary Fibonacci numbers mod 1e9

						# mod m=1e9, done for fast optimisation
						snake_case_					:Union[str, Any]		=     [0] * 1000000
						snake_case_					:str		=     1000000000

						for x in range(1000000      ):
												snake_case_					:Optional[Any]		=     (aa + ba) % m
												snake_case_					:Dict		=     ba % m
												snake_case_					:List[Any]		=     ca % m
												if checka(_lowercase      ):
																		snake_case_					:Dict		=     1

						for x in range(1000000      ):
												snake_case_					:Optional[int]		=     a + b
												snake_case_					:str		=     b
												snake_case_					:Tuple		=     c
												# perform check only if in tocheck
												if tocheck[x + 3] and check(_lowercase      ):
																		return x + 3  # first 2 already done
						return -1


if __name__ == "__main__":
						print(F"""{solution() = }""")



"""simple docstring"""

import os





def 					__UpperCamelCase (     )					->      int:




					"""simple docstring"""



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

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

					__lowercase        =      [[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]      )      ):
															__lowercase        =      a[i - 1][j] if j != len(a[i - 1]      ) else 0
															__lowercase        =      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())


