





from .hash_table import HashTable
from .number_theory.prime_numbers import is_prime, next_prime






class  __A   (   UpperCAmelCase__			):

							'''simple docstring'''







							def __init__(   self	,  *__lowerCAmelCase	,  **__lowerCAmelCase							):



								'''simple docstring'''







								super().__init__(*__lowerCAmelCase	,  **__lowerCAmelCase							)





							def 		__lowerCamelCase    (   self	,  __lowerCAmelCase	,  __lowerCAmelCase							):



								'''simple docstring'''







								lowerCamelCase__        =		(
								    next_prime(value % self.size_table							)
								    if not is_prime(value % self.size_table							)
								    else value % self.size_table
								)  # gt = bigger than
								return next_prime_gt - (data % next_prime_gt)





							def 		__lowerCamelCase    (   self	,  __lowerCAmelCase	,  __lowerCAmelCase	,  __lowerCAmelCase							):



								'''simple docstring'''







								return (increment * self.__hash_function_a(__lowerCAmelCase	,  __lowerCAmelCase							)) % self.size_table





							def 		__lowerCamelCase    (   self	,  __lowerCAmelCase	,  __lowerCAmelCase=None							):



								'''simple docstring'''







								lowerCamelCase__        =		1
								lowerCamelCase__        =		self.hash_function(__lowerCAmelCase							)

								while self.values[new_key] is not None and self.values[new_key] != key:
									lowerCamelCase__        =		(
									    self.__hash_double_function(__lowerCAmelCase	,  __lowerCAmelCase	,  __lowerCAmelCase							)
									    if self.balanced_factor() >= self.lim_charge
									    else None
									)
									if new_key is None:
										break
									else:
										i += 1

								return new_key










import os





def lowerCAmelCase__()    ->				int:







	'''simple docstring'''







	lowerCamelCase__        =		os.path.dirname(os.path.realpath(__snake_case							)							)
	lowerCamelCase__        =		os.path.join(__snake_case	,'''triangle.txt'''							)

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

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



