


import functools
from typing import Any






def   _lowercase(					__a				:						str    ,     __a				:						List[Any]     ):

							# Validation
							if not isinstance(__a    ,     __a     ) or len(__a     ) == 0:
														raise ValueError('the string should be not empty string'     )

							if not isinstance(__a    ,     __a     ) or not all(
							    isinstance(__a    ,     __a     ) and len(__a     ) > 0 for item in words     ):
														raise ValueError('the words should be a list of non-empty strings'     )

							# Build trie
							a__      ={}
							a__      ='WORD_KEEPER'

							for word in words:
														a__      =trie
														for c in word:
																					if c not in trie_node:
																												a__      ={}

																					a__      =trie_node[c]

														a__      =True

							a__      =len(__a     )

							# Dynamic programming method
							@functools.cache
							def is_breakable(__a				:						Tuple     ) -> bool:
														if index == len_string:
																					return True

														a__      =trie
														for i in range(__a    ,     __a     ):
																					a__      =trie_node.get(string[i]    ,     __a     )

																					if trie_node is None:
																												return False

																					if trie_node.get(__a    ,     __a     ) and is_breakable(i + 1     ):
																												return True

														return False

							return is_breakable(0     )


if __name__ == "__main__":
	import doctest

	doctest.testmod()









"""simple docstring"""
def 				lowercase__		(					lowerCamelCase,						lowerCamelCase       ):
				return abs(lowerCamelCase       ) if a == 0 else greatest_common_divisor(b % a,						lowerCamelCase       )





def 				lowercase__		(					lowerCamelCase,						lowerCamelCase       ):
				while y:  # --> when y=0 then loop will terminate and return x as final GCD.
								_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    y, x % y
				return abs(lowerCamelCase       )





def 				lowercase__		(					):
				try:
								_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    input('Enter two integers separated by comma (,): '       ).split(','       )
								_SCREAMING_SNAKE_CASE   :		Dict       		=    int(nums[0]       )
								_SCREAMING_SNAKE_CASE   :		Dict       		=    int(nums[1]       )
								print(
								    f"""greatest_common_divisor({num_a}, {num_a}) = """
								    f"""{greatest_common_divisor(lowerCamelCase,						lowerCamelCase       )}"""       )
								print(f"""By iterative gcd({num_a}, {num_a}) = {gcd_by_iterative(lowerCamelCase,						lowerCamelCase       )}"""       )
				except (IndexError, UnboundLocalError, ValueError):
								print('Wrong input'       )


if __name__ == "__main__":
			main()

