




from collections.abc import Sequence



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

  lowercase			:int							=  nums[0]
  for i in range(1,	len(lowerCamelCase      )      ):
    lowercase			:int							=  nums[i]
    lowercase			:int							=  max(lowerCamelCase,	ans + num,	lowerCamelCase      )

  return ans


if __name__ == "__main__":
     import doctest

     doctest.testmod()

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









def 					UpperCAmelCase__     (   lowerCamelCase,	lowerCamelCase      ):
  lowercase			:List[str]							=  ""
  for word_or_phrase in separated:
    if not isinstance(lowerCamelCase,	lowerCamelCase      ):
      raise Exception("join() accepts only strings to be joined"      )
    joined += word_or_phrase + separator
  return joined.strip(lowerCamelCase      )


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

     testmod()



