




'''simple docstring'''



# using dfs for finding eulerian path traversal
def 			SCREAMING_SNAKE_CASE_			(							__A    :			List[str]	,					__A    :			Optional[Any]	,					__A    :			Optional[int]	,					__A    :			List[str]=None  )			->			Optional[int]:
   _SCREAMING_SNAKE_CASE	=				(path or []) + [u]
   for v in graph[u]:
      if visited_edge[u][v] is False:
         _SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				True, True
         _SCREAMING_SNAKE_CASE	=				dfs(__A	,					__A	,					__A	,					__A  )
   return path
def 			SCREAMING_SNAKE_CASE_			(							__A    :			Tuple	,					__A    :			Optional[Any]  )			->			str:
   _SCREAMING_SNAKE_CASE	=				0
   _SCREAMING_SNAKE_CASE	=				-1
   for i in range(__A  ):
      if i not in graph.keys():
         continue
      if len(graph[i]  ) % 2 == 1:
         odd_degree_nodes += 1
         _SCREAMING_SNAKE_CASE	=				i
   if odd_degree_nodes == 0:
      return 1, odd_node
   if odd_degree_nodes == 2:
      return 2, odd_node
   return 3, odd_node
def 			SCREAMING_SNAKE_CASE_			(							__A    :			Union[str, Any]	,					__A    :			Optional[Any]  )			->			List[Any]:
   _SCREAMING_SNAKE_CASE	=				[[False for _ in range(max_node + 1  )] for _ in range(max_node + 1  )]
   _SCREAMING_SNAKE_CASE,	_SCREAMING_SNAKE_CASE	=				check_circuit_or_path(__A	,					__A  )
   if check == 3:
      print("graph is not Eulerian"  )
      print("no path"  )
      return
   _SCREAMING_SNAKE_CASE	=				1
   if check == 2:
      _SCREAMING_SNAKE_CASE	=				odd_node
      print("graph has a Euler path"  )
   if check == 1:
      print("graph has a Euler cycle"  )
   _SCREAMING_SNAKE_CASE	=				dfs(__A	,					__A	,					__A  )
   print(__A  )
def 			SCREAMING_SNAKE_CASE_			(							)			->			List[Any]:
   _SCREAMING_SNAKE_CASE	=				{1: [2, 3, 4], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [4]}
   _SCREAMING_SNAKE_CASE	=				{1: [2, 3, 4, 5], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [1, 4]}
   _SCREAMING_SNAKE_CASE	=				{1: [2, 3, 4], 2: [1, 3, 4], 3: [1, 2], 4: [1, 2, 5], 5: [4]}
   _SCREAMING_SNAKE_CASE	=				{1: [2, 3], 2: [1, 3], 3: [1, 2]}
   _SCREAMING_SNAKE_CASE	=				{
       1: [],
       2: []
       # all degree is zero
   }
   _SCREAMING_SNAKE_CASE	=				10
   check_euler(__A	,					__A  )
   check_euler(__A	,					__A  )
   check_euler(__A	,					__A  )
   check_euler(__A	,					__A  )
   check_euler(__A	,					__A  )


if __name__ == "__main__":
 main()







'''simple docstring'''



from collections.abc import Sequence
def 			SCREAMING_SNAKE_CASE_			(							__A    :			Sequence[int] | None = None  )			->			int:
   if nums is None or not nums:
      raise ValueError("Input sequence should not be empty"  )

   _SCREAMING_SNAKE_CASE	=				nums[0]
   for i in range(1	,					len(__A  )  ):
      _SCREAMING_SNAKE_CASE	=				nums[i]
      _SCREAMING_SNAKE_CASE	=				max(__A	,					ans + num	,					__A  )

   return ans


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 # Try on a sample input from the user
 lowerCamelCase_			=						int(input('Enter number of elements : ').strip())
 lowerCamelCase_			=						list(map(int, input('\nEnter the numbers : ').strip().split()))[:n]
 print(max_subsequence_sum(array))

