




'''simple docstring'''


from collections import deque
def 	snake_case_					(UpperCamelCase :						List[str]   ):





							'''simple docstring'''


							_a			  =       len(UpperCamelCase   )
							_a			  =       deque()
							_a			  =       [False for _ in range(UpperCamelCase   )]
							_a			  =       [-1 for _ in range(UpperCamelCase   )]
							_a			  =       index_of[:]

							def strong_connect(UpperCamelCase :						List[str]				,		UpperCamelCase :						int				,		UpperCamelCase :						Tuple   ):
														_a			  =       index  # the number when this node is seen
														_a			  =       index  # lowest rank node reachable from here
														index += 1
														stack.append(UpperCamelCase   )
														_a			  =       True

														for w in g[v]:
																					if index_of[w] == -1:
																												_a			  =       strong_connect(UpperCamelCase				,		UpperCamelCase				,		UpperCamelCase   )
																												_a			  =       (
																												    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
																												)
																					elif on_stack[w]:
																												_a			  =       (
																												    lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
																												)

														if lowlink_of[v] == index_of[v]:
																					_a			  =       []
																					_a			  =       stack.pop()
																					_a			  =       False
																					component.append(UpperCamelCase   )
																					while w != v:
																												_a			  =       stack.pop()
																												_a			  =       False
																												component.append(UpperCamelCase   )
																					components.append(UpperCamelCase   )
														return index

							_a			  =       []
							for v in range(UpperCamelCase   ):
														if index_of[v] == -1:
																					strong_connect(UpperCamelCase				,		0				,		UpperCamelCase   )

							return components
def 	snake_case_					(UpperCamelCase :						Union[str, Any]				,		UpperCamelCase :						Optional[Any]   ):





							'''simple docstring'''


							_a			  =       [[] for _ in range(UpperCamelCase   )]
							for u, v in edges:
														g[u].append(UpperCamelCase   )
							return g


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

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







'''simple docstring'''


_snake_case   :   Any     							=	tuple[float, float, float]
_snake_case   :   Optional[int]     							=	tuple[float, float, float]
def 	snake_case_					(UpperCamelCase :						Pointad				,		UpperCamelCase :						Pointad   ):





							'''simple docstring'''


							_a			  =       end_pointa[0] - end_pointa[0]
							_a			  =       end_pointa[1] - end_pointa[1]
							_a			  =       end_pointa[2] - end_pointa[2]
							return (x, y, z)
def 	snake_case_					(UpperCamelCase :						Vectorad				,		UpperCamelCase :						Vectorad   ):





							'''simple docstring'''


							_a			  =       ab[1] * ac[2] - ab[2] * ac[1]  # *i
							_a			  =       (ab[0] * ac[2] - ab[2] * ac[0]) * -1  # *j
							_a			  =       ab[0] * ac[1] - ab[1] * ac[0]  # *k
							return (x, y, z)
def 	snake_case_					(UpperCamelCase :						Vectorad				,		UpperCamelCase :						int   ):





							'''simple docstring'''


							return tuple(round(UpperCamelCase				,		UpperCamelCase   ) for x in vector   ) == (0, 0, 0)

def 	snake_case_					(UpperCamelCase :						Pointad				,		UpperCamelCase :						Pointad				,		UpperCamelCase :						Pointad				,		UpperCamelCase :						int = 10   ):





							'''simple docstring'''


							_a			  =       create_vector(UpperCamelCase				,		UpperCamelCase   )
							_a			  =       create_vector(UpperCamelCase				,		UpperCamelCase   )
							return is_zero_vector(get_ad_vectors_cross(UpperCamelCase				,		UpperCamelCase   )				,		UpperCamelCase   )

