






class 							__a							:





		'''simple docstring'''



		def __init__(						self       ):
						SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   {}


		def   __snake_case			(						self       ):
						print(self.vertex       )
						for i in self.vertex:
										print(UpperCamelCase__ ,    ' -> ' ,    ' -> '.join([str(UpperCamelCase__       ) for j in self.vertex[i]]       )       )


		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__       ):
						# check if vertex is already present,
						if from_vertex in self.vertex:
										self.vertex[from_vertex].append(UpperCamelCase__       )
						else:
										# else make a new vertex
										SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   [to_vertex]


		def   __snake_case			(						self       ):
						# visited array for storing already visited nodes
						SCREAMING_SNAKE_CASE_   :	List[Any]													=   [False] * len(self.vertex       )

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






		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__       ):
						# mark start vertex as visited
						SCREAMING_SNAKE_CASE_   :	str													=   True

						print(UpperCamelCase__ ,    end=' '       )

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


if __name__ == "__main__":
				A        =			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







import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union


@dataclass
class 							__a							:





		'''simple docstring'''



		UpperCAmelCase__      :				Optional[Union[str, Path]]				    =						None
		UpperCAmelCase__      :				bool				    =						False
		UpperCAmelCase__      :				bool				    =						False
		UpperCAmelCase__      :				bool				    =						False
		UpperCAmelCase__      :				Optional[Dict]				    =						None
		UpperCAmelCase__      :				Optional[str]				    =						None
		UpperCAmelCase__      :				bool				    =						False
		UpperCAmelCase__      :				bool				    =						False
		UpperCAmelCase__      :				bool				    =						False
		UpperCAmelCase__      :				bool				    =						True
		UpperCAmelCase__      :				Optional[int]				    =						None
		UpperCAmelCase__      :				int				    =						1
		UpperCAmelCase__      :				Optional[Union[str, bool]]				    =						None
		UpperCAmelCase__      :				bool				    =						False
		UpperCAmelCase__      :				Optional[Dict]				    =						None
		UpperCAmelCase__      :				Optional[str]				    =						None


		def   __snake_case			(						self       ):
						return self.__class__(**{k: copy.deepcopy(UpperCamelCase__       ) for k, v in self.__dict__.items()}       )