




import itertools





def 							A__   (snake_case      :		int = 1_00_00_00							)    ->	int:
     __UpperCamelCase				:  Optional[Any]								=			[1]

     for i in itertools.count(len(_A							)							):
          __UpperCamelCase				:  Any								=			0
          for j in itertools.count(1							):
               __UpperCamelCase				:  Union[str, Any]								=			-1 if j % 2 == 0 else +1
               __UpperCamelCase				:  List[Any]								=			(j * j * 3 - j) // 2
               if index > i:
                    break
               item += partitions[i - index] * sign
               item %= number
               index += j
               if index > i:
                    break
               item += partitions[i - index] * sign
               item %= number

          if item == 0:
               return i
          partitions.append(_A							)

     return 0


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 print(f"{solution() = }")












import os





def 							A__   ()    ->	int:
					__UpperCamelCase				:  int								=			os.path.dirname(os.path.realpath(snake_case							)							)
					__UpperCamelCase				:  List[str]								=			os.path.join(snake_case		,  """triangle.txt"""							)

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

					while len(snake_case							) != 1:
										__UpperCamelCase				:  Union[str, Any]								=			triangle.pop()
										__UpperCamelCase				:  List[str]								=			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())






