




'''simple docstring'''






import os

def      __lowerCAmelCase   (       ):
			__UpperCamelCase :     Any										=  os.path.dirname(os.path.realpath(snake_case__		)		)
			__UpperCamelCase :     List[Any]										=  os.path.join(snake_case__   , "triangle.txt"		)

			with open(snake_case__		) as in_file:
						__UpperCamelCase :     List[Any]										=  [[int(snake_case__		) for i in line.split()] for line in in_file]

			while len(snake_case__		) != 1:
						__UpperCamelCase :     int										=  triangle.pop()
						__UpperCamelCase :     Optional[Any]										=  triangle[-1]
						for j in range(len(snake_case__		) - 1		):
									curr_row[j] += max(last_row[j]   , last_row[j + 1]		)
			return triangle[0][0]


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









'''simple docstring'''






def      __lowerCAmelCase   (       snake_case__		):

			for insert_index, insert_value in enumerate(collection[1:]		):
						__UpperCamelCase :     Union[str, Any]										=  insert_index
						while insert_index >= 0 and insert_value < collection[insert_index]:
									__UpperCamelCase :     int										=  collection[insert_index]
									insert_index -= 1
						if insert_index != temp_index:
									__UpperCamelCase :     Tuple										=  insert_value
			return collection


if __name__ == "__main__":
				from doctest import testmod

				testmod()

				_lowerCAmelCase       =   input('''Enter numbers separated by a comma:\n''').strip()
				_lowerCAmelCase       =   [int(item) for item in user_input.split(''',''')]
				print(f'{insertion_sort(unsorted) = }')



