



from typing import List

from .keymap import KEYMAP, get_character
def 							UpperCAmelCase__		(				_SCREAMING_SNAKE_CASE   :	str				)->Tuple:

      def decorator(_SCREAMING_SNAKE_CASE   :	List[Any]				):
            _lowerCAmelCase 			=  getattr(_SCREAMING_SNAKE_CASE     ,				'''handle_key'''     ,				[]				)
            handle += [key]
            setattr(_SCREAMING_SNAKE_CASE     ,				'''handle_key'''     ,				_SCREAMING_SNAKE_CASE				)
            return func

      return decorator
def 							UpperCAmelCase__		(				*_SCREAMING_SNAKE_CASE   :	List[str]				)->Tuple:

      def decorator(_SCREAMING_SNAKE_CASE   :	Optional[Any]				):
            _lowerCAmelCase 			=  getattr(_SCREAMING_SNAKE_CASE     ,				'''handle_key'''     ,				[]				)
            handle += keys
            setattr(_SCREAMING_SNAKE_CASE     ,				'''handle_key'''     ,				_SCREAMING_SNAKE_CASE				)
            return func

      return decorator





class 		UpperCAmelCase						(						snake_case_				):





   def __new__(	cls       ,     _lowerCAmelCase       ,     _lowerCAmelCase       ,     _lowerCAmelCase			):
         _lowerCAmelCase 			=  super().__new__(cls       ,     _lowerCAmelCase       ,     _lowerCAmelCase       ,     _lowerCAmelCase			)
         if not hasattr(_lowerCAmelCase       ,     '''key_handler'''			):
               setattr(_lowerCAmelCase       ,     '''key_handler'''       ,     {}			)
         setattr(_lowerCAmelCase       ,     '''handle_input'''       ,     KeyHandler.handle_input			)

         for value in attrs.values():
               _lowerCAmelCase 			=  getattr(_lowerCAmelCase       ,     '''handle_key'''       ,     []			)
               for key in handled_keys:
                     _lowerCAmelCase 			=  value
         return new_cls





   @staticmethod
   def 	__lowerCAmelCase							(	cls			):
         _lowerCAmelCase 			=  get_character()
         if char != KEYMAP["undefined"]:
               _lowerCAmelCase 			=  ord(_lowerCAmelCase			)
         _lowerCAmelCase 			=  cls.key_handler.get(_lowerCAmelCase			)
         if handler:
               _lowerCAmelCase 			=  char
               return handler(cls			)
         else:
               return None






def 							UpperCAmelCase__		(				cls   :	Union[str, Any]				)->Optional[Any]:
      return KeyHandler(cls.__name__     ,				cls.__bases__     ,				cls.__dict__.copy()				)




def 							UpperCAmelCase__		(				_SCREAMING_SNAKE_CASE   :	Optional[Any]				)->Any:  # noqa: E741
      _lowerCAmelCase 			=  len(_SCREAMING_SNAKE_CASE				)
      _lowerCAmelCase 			=  0
      _lowerCAmelCase 			=  [0] * n
      _lowerCAmelCase 			=  [False] * n
      _lowerCAmelCase 			=  [False] * n

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

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

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

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

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


# Adjacency list of graph
UpperCAmelCase_									=							{
    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)