






"""simple docstring"""



import os


def      SCREAMING_SNAKE_CASE__    (   )->						Dict:






     '''simple docstring'''



     UpperCAmelCase__		:  Union[str, Any]				=				os.path.dirname(os.path.realpath(snake_case							)							)
     UpperCAmelCase__		:  List[str]				=				os.path.join(snake_case       , "triangle.txt"							)

     with open(snake_case							) as f:
          UpperCAmelCase__		:  Optional[int]				=				f.readlines()

     UpperCAmelCase__		:  Union[str, Any]				=				[[int(snake_case							) for y in x.rstrip("\r\n"							).split(" "							)] for x in triangle]

     for i in range(1       , len(snake_case							)							):
          for j in range(len(a[i]							)							):
               UpperCAmelCase__		:  Tuple				=				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(snake_case       , snake_case							)
     return max(a[-1]							)


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










"""simple docstring"""



def      SCREAMING_SNAKE_CASE__    (   snake_case    :      list       , snake_case    :      int       , snake_case    :      int							)->						None:






     '''simple docstring'''



     if right <= left:
          return
     UpperCAmelCase__		:  str				=				left
     UpperCAmelCase__		:  List[str]				=				right
     UpperCAmelCase__		:  List[Any]				=				sorting[left]
     while i <= b:
          if sorting[i] < pivot:
               UpperCAmelCase__				,							UpperCAmelCase__		:  List[str]				=				sorting[i], sorting[a]
               a += 1
               i += 1
          elif sorting[i] > pivot:
               UpperCAmelCase__				,							UpperCAmelCase__		:  Optional[int]				=				sorting[i], sorting[b]
               b -= 1
          else:
               i += 1
     quick_sort_apartition(snake_case       , snake_case       , a - 1							)
     quick_sort_apartition(snake_case       , b + 1       , snake_case							)


def      SCREAMING_SNAKE_CASE__    (   snake_case    :      list       , snake_case    :      int       , snake_case    :      int							)->						None:






     '''simple docstring'''



     if left < right:
          UpperCAmelCase__		:  int				=				lomuto_partition(snake_case       , snake_case       , snake_case							)
          quick_sort_lomuto_partition(snake_case       , snake_case       , pivot_index - 1							)
          quick_sort_lomuto_partition(snake_case       , pivot_index + 1       , snake_case							)


def      SCREAMING_SNAKE_CASE__    (   snake_case    :      list       , snake_case    :      int       , snake_case    :      int							)->						int:






     '''simple docstring'''



     UpperCAmelCase__		:  Union[str, Any]				=				sorting[right]
     UpperCAmelCase__		:  Optional[Any]				=				left
     for i in range(snake_case       , snake_case							):
          if sorting[i] < pivot:
               UpperCAmelCase__				,							UpperCAmelCase__		:  List[Any]				=				sorting[i], sorting[store_index]
               store_index += 1
     UpperCAmelCase__				,							UpperCAmelCase__		:  List[Any]				=				sorting[store_index], sorting[right]
     return store_index


def      SCREAMING_SNAKE_CASE__    (   snake_case    :      list							)->						list:






     '''simple docstring'''



     if len(snake_case							) <= 1:
          return sorting
     return (
         three_way_radix_quicksort([i for i in sorting if i < sorting[0]]							)
         + [i for i in sorting if i == sorting[0]]
         + three_way_radix_quicksort([i for i in sorting if i > sorting[0]]							)
     )


if __name__ == "__main__":
 import doctest

 doctest.testmod(verbose=True)

 _lowerCAmelCase     :     Optional[int]            =	input("""Enter numbers separated by a comma:\n""").strip()
 _lowerCAmelCase     :     str            =	[int(item) for item in user_input.split(""",""")]
 quick_sort_apartition(unsorted, 0, len(unsorted) - 1)
 print(unsorted)


