





from __future__ import annotations

from collections.abc import Generator



def _a							(      lowerCamelCase:  int					)      ->		Generator[int, None, None]:







      '''simple docstring'''






      if not isinstance(lowerCamelCase   ,							lowerCamelCase					) or n < 1:
            raise Exception('''Sequence only defined for positive integers'''					)

      yield n
      while n != 1:
            if n % 2 == 0:
                  n //= 2
            else:
                  __A			  =							3 * n + 1
            yield n



def _a							(      )      ->		List[Any]:







      '''simple docstring'''






      __A			  =							43
      __A			  =							tuple(collatz_sequence(lowerCamelCase					)					)
      print(lowerCamelCase					)
      print(F"""Collatz sequence from {n} took {len(lowerCamelCase					)} steps."""					)


if __name__ == "__main__":
       main()












import os



def _a							(      )      ->		int:







      '''simple docstring'''






      __A			  =							os.path.dirname(os.path.realpath(lowerCamelCase					)					)
      __A			  =							os.path.join(lowerCamelCase   ,							'''triangle.txt'''					)

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

      while len(lowerCamelCase					) != 1:
            __A			  =							triangle.pop()
            __A			  =							triangle[-1]
            for j in range(len(lowerCamelCase					) - 1					):
                  curr_row[j] += max(last_row[j]   ,							last_row[j + 1]					)
      return triangle[0][0]


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





