def 							lowerCAmelCase(	__lowerCamelCase						):
					__a							=   len(snake_case__						)

					# Set the gap value to be decreased by a factor of 1.3
					# after each iteration
					__a							=   1.3

					# Continue sorting until the gap is 1
					while gap > 1:
										# Decrease the gap value
										__a							=   int(gap / shrink						)

										# Sort the elements using insertion sort
										for i in range(snake_case__      ,				len(snake_case__						)						):
															__a							=   collection[i]
															__a							=   i
															while j >= gap and collection[j - gap] > temp:
																				__a							=   collection[j - gap]
																				j -= gap
															__a							=   temp

					return collection


if __name__ == "__main__":
	import doctest

	doctest.testmod()







import os
def 						UpperCamelCase_(			)       -> int:
 UpperCAmelCase__							=				os.path.dirname(os.path.realpath(snake_case__   )   )
 UpperCAmelCase__							=				os.path.join(snake_case__  ,    'triangle.txt'   )

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

 while len(snake_case__   ) != 1:
  UpperCAmelCase__							=				triangle.pop()
  UpperCAmelCase__							=				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())



