

"""simple docstring"""

from __future__ import annotations

import re





def 					__UpperCamelCase (     a__:			list[str]      )					->      list[str]:




					"""simple docstring"""



					def alphanum_key(a__:			List[Any]      ):
										return [int(a__      ) if s.isdigit() else s.lower() for s in re.split('''([0-9]+)'''			,						a__      )]

					return sorted(a__			,						key=a__      )


if __name__ == "__main__":
							import doctest

							doctest.testmod()





"""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())


