
class 						__lowerCAmelCase	:



      """simple docstring"""







      def __init__(      self		:       int				):
          __lowercase		:			Any	    =       {}




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




      def 		snake_case_			(      self		:       str				,       _snake_case		:       Optional[int]				,       _snake_case		:       str				):
          # check if vertex is already present,
          if from_vertex in self.vertex:
              self.vertex[from_vertex].append(lowerCAmelCase__				)
          else:
              # else make a new vertex
              __lowercase		:			List[str]	    =       [to_vertex]




      def 		snake_case_			(      self		:       Union[str, Any]				):
          # visited array for storing already visited nodes
          __lowercase		:			List[str]	    =       [False] * len(self.vertex				)

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




      def 		snake_case_			(      self		:       Optional[int]				,       _snake_case		:       Optional[int]				,       _snake_case		:       List[Any]				):
          # mark start vertex as visited
          __lowercase		:			List[str]	    =       True

          print(lowerCAmelCase__				,       end=''' '''				)

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


if __name__ == "__main__":
 __lowerCAmelCase					:			Optional[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




from __future__ import annotations


def     UpperCAmelCase_  (						__lowerCAmelCase	) ->						int:
    if not nums:
        return 0
    __lowercase		:			List[Any]	    =       nums[0]
    __lowercase		:			Union[str, Any]	    =       0
    for num in nums[1:]:
        __lowercase    ,      __lowercase		:			Dict	    =       (
            max_excluding + num,
            max(__lowerCAmelCase	,					__lowerCAmelCase	),
        )
    return max(__lowerCAmelCase	,					__lowerCAmelCase	)


if __name__ == "__main__":
 import doctest

 doctest.testmod()


