


class 			lowerCamelCase__						:







						def __init__(							self   :    Any		):
								A					       = {}







						def __a						(							self   :    Optional[Any]		):
								print(self.vertex		)
								for i in self.vertex:
										print(_SCREAMING_SNAKE_CASE			,			' -> '			,			' -> '.join([str(_SCREAMING_SNAKE_CASE		) for j in self.vertex[i]]		)		)







						def __a						(							self   :    int			,			_lowercase   :    List[Any]			,			_lowercase   :    Optional[Any]		):
								# check if vertex is already present,
								if from_vertex in self.vertex:
										self.vertex[from_vertex].append(_SCREAMING_SNAKE_CASE		)
								else:
										# else make a new vertex
										A					       = [to_vertex]







						def __a						(							self   :    List[str]		):
								# visited array for storing already visited nodes
								A					       = [False] * len(self.vertex		)

								# call the recursive helper function
								for i in range(len(self.vertex		)		):
										if not visited[i]:
												self.dfs_recursive(_SCREAMING_SNAKE_CASE			,			_SCREAMING_SNAKE_CASE		)







						def __a						(							self   :    Dict			,			_lowercase   :    List[str]			,			_lowercase   :    Optional[Any]		):
								# mark start vertex as visited
								A					       = True

								print(_SCREAMING_SNAKE_CASE			,			end=' '		)

								# Recur for all the vertices that are adjacent to this node
								for i in self.vertex:
										if not visited[i]:
												self.dfs_recursive(_SCREAMING_SNAKE_CASE			,			_SCREAMING_SNAKE_CASE		)


if __name__ == "__main__":
	UpperCamelCase						:				Union[str, Any]             =      Graph()
	g.add_edge(0, 1)
	g.add_edge(0, 2)
	g.add_edge(1, 2)
	g.add_edge(2, 0)
	g.add_edge(2, 3)
	g.add_edge(3, 3)

	g.print_graph()
	print("DFS:")
	g.dfs()

	# OUTPUT:
	# 0  ->  1 -> 2
	# 1  ->  2
	# 2  ->  0 -> 3
	# 3  ->  3
	# DFS:
	#  0 1 2 3









"""simple docstring"""


def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		while b:
				A       , A					       = b, a % b
		return a







def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		return a if b == 0 else euclidean_gcd_recursive(UpperCamelCase__ ,			a % b	)







def  __snake_case       (   )      ->		List[Any]:







		"""simple docstring"""





		print(f'euclidean_gcd(3, 5) = {euclidean_gcd(3 ,			5	)}'	)
		print(f'euclidean_gcd(5, 3) = {euclidean_gcd(5 ,			3	)}'	)
		print(f'euclidean_gcd(1, 3) = {euclidean_gcd(1 ,			3	)}'	)
		print(f'euclidean_gcd(3, 6) = {euclidean_gcd(3 ,			6	)}'	)
		print(f'euclidean_gcd(6, 3) = {euclidean_gcd(6 ,			3	)}'	)

		print(f'euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3 ,			5	)}'	)
		print(f'euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5 ,			3	)}'	)
		print(f'euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1 ,			3	)}'	)
		print(f'euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3 ,			6	)}'	)
		print(f'euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6 ,			3	)}'	)


if __name__ == "__main__":
	main()





