




"""simple docstring"""





from __future__ import annotations

from queue import Queue

class    __lowercase							:


				'''simple docstring'''


				def __init__( self :  List[Any]   ):
										snake_case__							:       dict[int, list[int]]				      =       {}

				def    _lowerCamelCase       ( self :  Optional[int]   ):
										for i in self.vertices:
																print(SCREAMING_SNAKE_CASE_   ,''' : '''   ,''' -> '''.join([str(SCREAMING_SNAKE_CASE_   ) for j in self.vertices[i]]   )   )

				def    _lowerCamelCase       ( self :  Tuple   ,SCREAMING_SNAKE_CASE_ :  int   ,SCREAMING_SNAKE_CASE_ :  int   ):
										if from_vertex in self.vertices:
																self.vertices[from_vertex].append(SCREAMING_SNAKE_CASE_   )
										else:
																snake_case__							:       Optional[int]				      =       [to_vertex]





				def    _lowerCamelCase       ( self :  List[Any]   ,SCREAMING_SNAKE_CASE_ :  int   ):
										snake_case__							:       Optional[int]				      =       set()

										# create a first in first out queue to store all the vertices for BFS
										snake_case__							:       Queue				      =       Queue()

										# mark the source node as visited and enqueue it
										visited.add(SCREAMING_SNAKE_CASE_   )
										queue.put(SCREAMING_SNAKE_CASE_   )

										while not queue.empty():
																snake_case__							:       Optional[Any]				      =       queue.get()

																# loop through all adjacent vertex and enqueue it if not yet visited
																for adjacent_vertex in self.vertices[vertex]:
																						if adjacent_vertex not in visited:
																												queue.put(SCREAMING_SNAKE_CASE_   )
																												visited.add(SCREAMING_SNAKE_CASE_   )
										return visited


if __name__ == "__main__":
							from doctest import testmod

							testmod(verbose=True)

							_lowercase						   =     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()
							# 0  :  1 -> 2
							# 1  :  2
							# 2  :  0 -> 3
							# 3  :  3

							assert sorted(g.bfs(2)) == [0, 1, 2, 3]








"""simple docstring"""





from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
_lowercase						   =     TypeVar("""T""", bound="""Enum""")

@unique
class    __lowercase							(      snake_case_						):


				'''simple docstring'''


				_lowerCAmelCase						      =80
				_lowerCAmelCase						      =70
				_lowerCAmelCase						      =60
				_lowerCAmelCase						      =50
				_lowerCAmelCase						      =40
				_lowerCAmelCase						      =30
				_lowerCAmelCase						      =20
				_lowerCAmelCase						      =10







@unique
class    __lowercase							(      snake_case_						):


				'''simple docstring'''


				_lowerCAmelCase						      =24
				_lowerCAmelCase						      =21
				_lowerCAmelCase						      =18
				_lowerCAmelCase						      =15
				_lowerCAmelCase						      =12
				_lowerCAmelCase						      =9
				_lowerCAmelCase						      =6
				_lowerCAmelCase						      =3
				_lowerCAmelCase						      =2
				_lowerCAmelCase						      =1
				_lowerCAmelCase						      =-1
				_lowerCAmelCase						      =-2
				_lowerCAmelCase						      =-3
				_lowerCAmelCase						      =-6
				_lowerCAmelCase						      =-9
				_lowerCAmelCase						      =-12
				_lowerCAmelCase						      =-15
				_lowerCAmelCase						      =-18
				_lowerCAmelCase						      =-21
				_lowerCAmelCase						      =-24

				@classmethod
				def    _lowerCamelCase       ( cls :  type[T]   ):
										return {unit.name: unit.value for unit in cls if unit.value > 0}





				@classmethod
				def    _lowerCamelCase       ( cls :  type[T]   ):
										return {unit.name: unit.value for unit in cls if unit.value < 0}







def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						snake_case__							:       List[Any]				      =       SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
						for name_prefix, value_prefix in prefixes.items():
												snake_case__							:       Optional[int]				      =       value / (10**value_prefix)
												if numerical_part > 1:
																		return f'''{numerical_part!s} {name_prefix}'''
						return str(lowerCamelCase		)

def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						for prefix in BinaryUnit:
												snake_case__							:       int				      =       value / (2**prefix.value)
												if numerical_part > 1:
																		return f'''{numerical_part!s} {prefix.name}'''
						return str(lowerCamelCase		)


if __name__ == "__main__":
							import doctest

							doctest.testmod()


