






import os





def 						A_					(						)				->Dict:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		os.path.dirname(os.path.realpath(lowercase_			)			)
 SCREAMING_SNAKE_CASE				    =		os.path.join(lowercase_	,  'triangle.txt'			)

 with open(lowercase_			) as f:
  SCREAMING_SNAKE_CASE				    =		f.readlines()

 SCREAMING_SNAKE_CASE				    =		[[int(lowercase_			) for y in x.rstrip('\r\n'			).split(' '			)] for x in triangle]

 for i in range(1	,  len(lowercase_			)			):
  for j in range(len(a[i]			)			):
   SCREAMING_SNAKE_CASE				    =		a[i - 1][j] if j != len(a[i - 1]			) else 0
   SCREAMING_SNAKE_CASE				    =		a[i - 1][j - 1] if j > 0 else 0
   a[i][j] += max(lowercase_	,  lowercase_			)
 return max(a[-1]			)


if __name__ == "__main__":
      print(solution())












def       _a   (							lowerCamelCase__				)  ->      list[int]:
 if len(lowerCamelCase__				) > 1:
  lowerCamelCase_							:    Optional[Any]							=     len(lowerCamelCase__				) // 2  # Finds the middle of the array
  lowerCamelCase_							:    int							=     arr[
      :middle_length
  ]  # Creates an array of the elements in the first half.
  lowerCamelCase_							:    List[Any]							=     arr[
      middle_length:
  ]  # Creates an array of the elements in the second half.
  lowerCamelCase_							:    Optional[Any]							=     len(lowerCamelCase__				)
  lowerCamelCase_							:    Optional[Any]							=     len(lowerCamelCase__				)
  merge(lowerCamelCase__				)  # Starts sorting the left.
  merge(lowerCamelCase__				)  # Starts sorting the right
  lowerCamelCase_							:    Dict							=     0  # Left Counter
  lowerCamelCase_							:    str							=     0  # Right Counter
  lowerCamelCase_							:    Tuple							=     0  # Position Counter
  while (
      left_index < left_size and right_index < right_size
  ):  # Runs until the lowers size of the left and right are sorted.
   if left_array[left_index] < right_array[right_index]:
    lowerCamelCase_							:    Optional[int]							=     left_array[left_index]
    left_index += 1
   else:
    lowerCamelCase_							:    Union[str, Any]							=     right_array[right_index]
    right_index += 1
   index += 1
  while (
      left_index < left_size
  ):  # Adds the left over elements in the left half of the array
   lowerCamelCase_							:    Tuple							=     left_array[left_index]
   left_index += 1
   index += 1
  while (
      right_index < right_size
  ):  # Adds the left over elements in the right half of the array
   lowerCamelCase_							:    Optional[int]							=     right_array[right_index]
   right_index += 1
   index += 1
 return arr


if __name__ == "__main__":
       import doctest

       doctest.testmod()
