




import os




def        __SCREAMING_SNAKE_CASE (	)							->						str:

    """simple docstring"""


    __UpperCamelCase			=    os.path.dirname(os.path.realpath(A__   )   )
    __UpperCamelCase			=    os.path.join(A__       ,  '''triangle.txt'''   )

    with open(A__   ) as f:
        __UpperCamelCase			=    f.readlines()

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










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



