
"""simple docstring"""
def      lowerCamelCase_     (						lowerCamelCase_						,					lowerCamelCase_			)  ->      Optional[Any]:


					'''simple docstring'''
					__a:    Optional[Any]		     =       0
					for ele in arr:
										total_sum += product_sum(A__						,					depth + 1			) if isinstance(A__						,					A__			) else ele
					return total_sum * depth


def      lowerCamelCase_     (						lowerCamelCase_			)  ->      Any:


					'''simple docstring'''
					return product_sum(A__						,					1			)


if __name__ == "__main__":
			import doctest

			doctest.testmod()




import os







def 	A (		):
     UpperCAmelCase    :					Any			=      os.path.dirname(os.path.realpath(A__			)			)
     UpperCAmelCase    :					Optional[int]			=      os.path.join(A__		,		"triangle.txt"			)

     with open(A__			) as f:
          UpperCAmelCase    :					Union[str, Any]			=      f.readlines()

     UpperCAmelCase    :					List[str]			=      [[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]			)			):
               UpperCAmelCase    :					List[Any]			=      a[i - 1][j] if j != len(a[i - 1]			) else 0
               UpperCAmelCase    :					Optional[int]			=      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())



