'''simple docstring'''
from collections.abc import Sequence



def  __lowerCamelCase       (      _UpperCamelCase  :  Dict = None					):


      '''simple docstring'''


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

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

      return ans


if __name__ == "__main__":
      import doctest

      doctest.testmod()

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



'''simple docstring'''
def  __lowerCamelCase       (      _UpperCamelCase  :  str							,    _UpperCamelCase  :  list[str]					):


      '''simple docstring'''


      UpperCAmelCase_            =  ''''''
      for word_or_phrase in separated:
            if not isinstance(_UpperCamelCase							,    _UpperCamelCase					):
                  raise Exception('''join() accepts only strings to be joined'''					)
            joined += word_or_phrase + separator
      return joined.strip(_UpperCamelCase					)


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

      testmod()





