





'''simple docstring'''






from collections.abc import Sequence
def   UpperCamelCase__ (						lowerCAmelCase = None    ):





      """simple docstring"""


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

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

      return ans


if __name__ == "__main__":
      import doctest

      doctest.testmod()

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













'''simple docstring'''






def   UpperCamelCase__ (						lowerCAmelCase				,      lowerCAmelCase    ):





      """simple docstring"""


      _lowerCAmelCase					=				""""""
      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()






