






'''simple docstring'''



class UpperCAmelCase_					:




      """simple docstring"""




      def __init__( self			:		Union[str, Any]		)  ->  Union[str, Any]:


       '''simple docstring'''

       lowercase					:   Optional[Any]				  ={}






      def 				A__      ( self			:		Any		)  ->  None:


       '''simple docstring'''

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






      def 				A__      ( self			:		Optional[Any]     ,      UpperCAmelCase			:		int     ,      UpperCAmelCase			:		int		)  ->  None:


       '''simple docstring'''

       if from_vertex in self.vertex:
        self.vertex[from_vertex].append(UpperCAmelCase		)
       else:
        # else make a new vertex
        lowercase					:   Any				  =[to_vertex]






      def 				A__      ( self			:		List[str]		)  ->  None:


       '''simple docstring'''

       lowercase					:   Optional[int]				  =[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 				A__      ( self			:		List[str]     ,      UpperCAmelCase			:		int     ,      UpperCAmelCase			:		list		)  ->  None:


       '''simple docstring'''

       lowercase					:   int				  =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__":
      SCREAMING_SNAKE_CASE						=	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 							lowercase_				(    __A :       int					,      __A :       int			)       ->      str:



 """simple docstring"""




 if number < 0 or shift_amount < 0:
  raise ValueError('''both inputs must be positive integers'''			)

 lowercase					:   List[Any]				  =str(bin(__A			)			)
 binary_number += "0" * shift_amount
 return binary_number


def 							lowercase_				(    __A :       int					,      __A :       int			)       ->      str:



 """simple docstring"""




 if number < 0 or shift_amount < 0:
  raise ValueError('''both inputs must be positive integers'''			)

 lowercase					:   Union[str, Any]				  =str(bin(__A			)			)[2:]
 if shift_amount >= len(__A			):
  return "0b0"
 lowercase					:   Any				  =binary_number[: len(__A			) - shift_amount]
 return "0b" + shifted_binary_number


def 							lowercase_				(    __A :       int					,      __A :       int			)       ->      str:



 """simple docstring"""




 if number >= 0:  # Get binary representation of positive number
  lowercase					:   str				  ='''0''' + str(bin(__A			)			).strip('''-'''			)[2:]
 else:  # Get binary (2's complement) representation of negative number
  lowercase					:   Dict				  =len(bin(__A			)[3:]			)  # Find 2's complement of number
  lowercase					:   Optional[Any]				  =bin(abs(__A			) - (1 << binary_number_length)			)[3:]
  lowercase					:   int				  =(
      '''1''' + '''0''' * (binary_number_length - len(__A			)) + binary_number
  )

 if shift_amount >= len(__A			):
  return "0b" + binary_number[0] * len(__A			)
 return (
     "0b"
     + binary_number[0] * shift_amount
     + binary_number[: len(__A			) - shift_amount]
 )


if __name__ == "__main__":
      import doctest

      doctest.testmod()



