


class  A_ :







 """simple docstring"""





 def __init__(      self       :			List[str]							,     _a       :			int					)     ->      None:
      UpperCAmelCase    :					Tuple			=      data
      UpperCAmelCase    :					BinaryTreeNode | None			=      None
      UpperCAmelCase    :					BinaryTreeNode | None			=      None







def 	A (		A__		,		A__			):
     if node is None:
          UpperCAmelCase    :					Union[str, Any]			=      BinaryTreeNode(A__			)
          return node

     # binary search tree is not empty,
     # so we will insert it into the tree
     # if new_value is less than value of data in node,
     #  add it to left subtree and proceed recursively
     if new_value < node.data:
          UpperCAmelCase    :					int			=      insert(node.left_child		,		A__			)
     else:
          # if new_value is greater than value of data in node,
          #  add it to right subtree and proceed recursively
          UpperCAmelCase    :					int			=      insert(node.right_child		,		A__			)
     return node







def 	A (		A__			):  # if node is None,return
     if node:
          UpperCAmelCase    :					int			=      inorder(node.left_child			)
          UpperCAmelCase    :					str			=      [*inorder_array, node.data]
          UpperCAmelCase    :					List[str]			=      inorder_array + inorder(node.right_child			)
     else:
          UpperCAmelCase    :					str			=      []
     return inorder_array







def 	A (		):
     UpperCAmelCase    :					Tuple			=      insert(A__		,		1_5			)
     insert(A__		,		1_0			)
     insert(A__		,		2_5			)
     insert(A__		,		6			)
     insert(A__		,		1_4			)
     insert(A__		,		2_0			)
     insert(A__		,		6_0			)
     return root







def 	A (		):
     # main function
     UpperCAmelCase    :					str			=      make_tree()
     print("Printing values of binary search tree in Inorder Traversal."			)
     inorder(A__			)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()







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



