'''simple docstring'''

def __a (	__lowerCamelCase			:						Optional[Any]				)	->							Optional[int]:  # noqa: E741
      '''simple docstring'''


      lowercase_     =      len(_lowercase				)
      lowercase_     =      0
      lowercase_     =      [0] * n
      lowercase_     =      [False] * n
      lowercase_     =      [False] * n

      def dfs(__lowerCamelCase			:						List[Any] ,		__lowerCamelCase			:						int ,		__lowerCamelCase			:						List[Any] ,		__lowerCamelCase			:						List[str]				):
            if parent == root:
                  out_edge_count += 1
            lowercase_     =      True
            lowercase_     =      at

            for to in l[at]:
                  if to == parent:
                        pass
                  elif not visited[to]:
                        lowercase_     =      dfs(_lowercase ,		_lowercase ,		_lowercase ,		_lowercase				)
                        lowercase_     =      min(low[at] ,		low[to]				)

                        # AP found via bridge
                        if at < low[to]:
                              lowercase_     =      True
                        # AP found via cycle
                        if at == low[to]:
                              lowercase_     =      True
                  else:
                        lowercase_     =      min(low[at] ,		_lowercase				)
            return out_edge_count

      for i in range(_lowercase				):
            if not visited[i]:
                  lowercase_     =      0
                  lowercase_     =      dfs(_lowercase ,		_lowercase ,		-1 ,		_lowercase				)
                  lowercase_     =      out_edge_count > 1

      for x in range(len(_lowercase				)				):
            if is_art[x] is True:
                  print(_lowercase				)


# Adjacency list of graph
lowerCAmelCase_ : str						  =      {
    0: [1, 2],
    1: [0, 2],
    2: [0, 1, 3, 5],
    3: [2, 4],
    4: [3],
    5: [2, 6, 8],
    6: [5, 7],
    7: [6, 8],
    8: [5, 7],
}






compute_ap(data)







'''simple docstring'''

import functools
from typing import Any


def __a (	__lowerCamelCase			:						str ,		__lowerCamelCase			:						list[str]				)	->							bool:
      '''simple docstring'''


      if not isinstance(__lowerCamelCase ,		__lowerCamelCase				) or len(__lowerCamelCase				) == 0:
            raise ValueError("the string should be not empty string"				)

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

      # Build trie
      lowercase_     =      {}
      lowercase_     =      "WORD_KEEPER"

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

                  lowercase_     =      trie_node[c]

            lowercase_     =      True

      lowercase_     =      len(__lowerCamelCase				)

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

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

                  if trie_node is None:
                        return False

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

            return False

      return is_breakable(0				)


if __name__ == "__main__":
       import doctest

       doctest.testmod()






