



"""simple docstring"""






from collections import deque






def 	snake_case_  (				A_ :		Optional[Any]						):


       '''simple docstring'''





       _lowerCamelCase						:    Any         =			len(a__						)
       _lowerCamelCase						:    Tuple         =			deque()
       _lowerCamelCase						:    Union[str, Any]         =			[False for _ in range(a__						)]
       _lowerCamelCase						:    Optional[Any]         =			[-1 for _ in range(a__						)]
       _lowerCamelCase						:    Dict         =			index_of[:]

       def strong_connect(A_ :		Dict,    A_ :		str,    A_ :		Union[str, Any]						):
              _lowerCamelCase						:    str         =			index  # the number when this node is seen
              _lowerCamelCase						:    List[str]         =			index  # lowest rank node reachable from here
              index += 1
              stack.append(a__						)
              _lowerCamelCase						:    Any         =			True

              for w in g[v]:
                     if index_of[w] == -1:
                            _lowerCamelCase						:    int         =			strong_connect(a__,    a__,    a__						)
                            _lowerCamelCase						:    int         =			(
                                lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                            )
                     elif on_stack[w]:
                            _lowerCamelCase						:    Any         =			(
                                lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                            )

              if lowlink_of[v] == index_of[v]:
                     _lowerCamelCase						:    List[Any]         =			[]
                     _lowerCamelCase						:    int         =			stack.pop()
                     _lowerCamelCase						:    Dict         =			False
                     component.append(a__						)
                     while w != v:
                            _lowerCamelCase						:    List[Any]         =			stack.pop()
                            _lowerCamelCase						:    Any         =			False
                            component.append(a__						)
                     components.append(a__						)
              return index

       _lowerCamelCase						:    int         =			[]
       for v in range(a__						):
              if index_of[v] == -1:
                     strong_connect(a__,    0,    a__						)

       return components






def 	snake_case_  (				A_ :		Any,    A_ :		List[Any]						):


       '''simple docstring'''





       _lowerCamelCase						:    Any         =			[[] for _ in range(a__						)]
       for u, v in edges:
              g[u].append(a__						)
       return g


if __name__ == "__main__":
   # Test
   lowerCAmelCase__ :    str      =    7
   lowerCAmelCase__ :    List[str]      =    [0, 0, 1, 2, 3, 3, 4, 4, 6]
   lowerCAmelCase__ :    List[Any]      =    [1, 3, 2, 0, 1, 4, 5, 6, 5]
   lowerCAmelCase__ :    int      =    [(u, v) for u, v in zip(source, target)]
   lowerCAmelCase__ :    Optional[Any]      =    create_graph(n_vertices, edges)

   assert [[5], [6], [4], [3, 2, 1, 0]] == tarjan(g)







"""simple docstring"""






from maths.prime_factors import prime_factors






def 	snake_case_  (				A_ :		int						):


       '''simple docstring'''





       if not isinstance(A_,    A_						):
              _lowerCamelCase						:    str         =			F'''Input value of [number={number}] must be an integer'''
              raise TypeError(A_						)
       if number < 1:
              raise ValueError('''Input must be a positive integer'''						)
       return -1 if len(prime_factors(A_						)						) % 2 else 1


if __name__ == "__main__":
   import doctest

   doctest.testmod()


