
"""simple docstring"""

import functools
from typing import Any






def 							A						(    snake_case				:str    , snake_case				:list[str]		)				->     bool:

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

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

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

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

   __UpperCamelCase      =	trie_node[c]

  __UpperCamelCase      =	True

 __UpperCamelCase      =	len(_UpperCAmelCase		)

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

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

   if trie_node is None:
    return False

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

  return False

 return is_breakable(0		)


if __name__ == "__main__":
      import doctest

      doctest.testmod()





"""simple docstring"""

def 							A						(    snake_case				:int		)				->     bool:
 return sum(i for i in range(1    , number // 2 + 1		) if number % i == 0		) == number


if __name__ == "__main__":
      print("Program to check whether a number is a Perfect number or not...")
      UpperCamelCase     :    Union[str, Any]       =			int(input("Enter number: ").strip())
      print(f'''{number} is {"" if perfect(number) else "not "}a Perfect Number.''')



