


"""simple docstring"""



from collections.abc import Sequence







def     __lowerCAmelCase		(		lowercase    :    Optional[int] = None					)      ->		Optional[Any]:


    """simple docstring"""





    if nums is None or not nums:
        raise ValueError("Input sequence should not be empty"					)

    snake_case       : Union[str, Any]    =       nums[0]
    for i in range(1		,				len(lowerCAmelCase__					)					):
        snake_case       : Any    =       nums[i]
        snake_case       : List[Any]    =       max(lowerCAmelCase__		,				ans + num		,				lowerCAmelCase__					)

    return ans


if __name__ == "__main__":
  import doctest

  doctest.testmod()

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












_lowercase		:  Any			       ={"""a""": ["""c""", """b"""], """b""": ["""d""", """e"""], """c""": [], """d""": [], """e""": []}
_lowercase		:  Union[str, Any]			       =["""a""", """b""", """c""", """d""", """e"""]


def 		_SCREAMING_SNAKE_CASE     ( lowerCAmelCase__							,lowerCAmelCase__							,lowerCAmelCase__						):
		lowerCamelCase_	:     int 						=      start
		# add current to visited
		visited.append(lowerCAmelCase__						)
		lowerCamelCase_	:     Optional[int] 						=      edges[current]
		for neighbor in neighbors:
				# if neighbor not in visited, visit
				if neighbor not in visited:
						lowerCamelCase_	:     Dict 						=      topological_sort(lowerCAmelCase__							,lowerCAmelCase__							,lowerCAmelCase__						)
    # if all neighbors visited add current to sort
		sort.append(lowerCAmelCase__						)
		# if all vertices haven't been visited select a new one to visit
		if len(lowerCAmelCase__						) != len(lowerCAmelCase__						):
				for vertice in vertices:
						if vertice not in visited:
								lowerCamelCase_	:     Any 						=      topological_sort(lowerCAmelCase__							,lowerCAmelCase__							,lowerCAmelCase__						)
    # return sort
		return sort


if __name__ == "__main__":
		_lowercase		:  str			       =topological_sort("""a""", [], [])
		print(sort)
