
UpperCAmelCase     				=			{
    '''0000''': '''0''',
    '''0001''': '''1''',
    '''0010''': '''2''',
    '''0011''': '''3''',
    '''0100''': '''4''',
    '''0101''': '''5''',
    '''0110''': '''6''',
    '''0111''': '''7''',
    '''1000''': '''8''',
    '''1001''': '''9''',
    '''1010''': '''a''',
    '''1011''': '''b''',
    '''1100''': '''c''',
    '''1101''': '''d''',
    '''1110''': '''e''',
    '''1111''': '''f''',
}






def 							UpperCAmelCase_		(							__SCREAMING_SNAKE_CASE							):
	lowercase					  =   str(__SCREAMING_SNAKE_CASE							).strip()

	# Exceptions
	if not binary_str:
		raise ValueError('Empty string was passed to the function'							)
	lowercase					  =   binary_str[0] == '-'
	lowercase					  =   binary_str[1:] if is_negative else binary_str
	if not all(char in '01' for char in binary_str							):
		raise ValueError('Non-binary value was passed to the function'							)

	lowercase					  =   (
	    '0' * (4 * (divmod(len(__SCREAMING_SNAKE_CASE							)			,							4							)[0] + 1) - len(__SCREAMING_SNAKE_CASE							)) + binary_str
	)

	lowercase					  =   []
	for x in range(0			,							len(__SCREAMING_SNAKE_CASE							)			,							4							):
		hexadecimal.append(BITS_TO_HEX[binary_str[x : x + 4]]							)
	lowercase					  =   '0x' + ''.join(__SCREAMING_SNAKE_CASE							)

	return "-" + hexadecimal_str if is_negative else hexadecimal_str


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

	testmod()



from __future__ import annotations

from queue import Queue







class 	A_       :




	'''simple docstring'''


	def __init__(	self	):
		lowercase					  =   {}





	def      SCREAMING_SNAKE_CASE__						(	self	):
		for i in self.vertices:
			print(snake_case		,   ' : '		,   ' -> '.join([str(snake_case	) for j in self.vertices[i]]	)	)





	def      SCREAMING_SNAKE_CASE__						(	self		,   snake_case		,   snake_case	):
		if from_vertex in self.vertices:
			self.vertices[from_vertex].append(snake_case	)
		else:
			lowercase					  =   [to_vertex]





	def      SCREAMING_SNAKE_CASE__						(	self		,   snake_case	):
		lowercase					  =   set()

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

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

		while not queue.empty():
			lowercase					  =   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(snake_case	)
					visited.add(snake_case	)
		return visited


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

	testmod(verbose=True)

	UpperCAmelCase     				=			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]

