


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







def   _A			( _SCREAMING_SNAKE_CASE = None			)      ->			int:
							if nums is None or not nums:
														raise ValueError("""Input sequence should not be empty"""			)

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

							return ans


if __name__ == "__main__":
				import doctest

				doctest.testmod()

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







"""simple docstring"""
def   _a			( _SCREAMING_SNAKE_CASE			,	_SCREAMING_SNAKE_CASE = 0			)      ->			list:
							snake_case_          =						length or len(_SCREAMING_SNAKE_CASE			)
							snake_case_          =						False
							for i in range(length - 1			):
														if list_data[i] > list_data[i + 1]:
																					snake_case_    ,  snake_case_          =						list_data[i + 1], list_data[i]
																					snake_case_          =						True

							return list_data if not swapped else bubble_sort(_SCREAMING_SNAKE_CASE			,	length - 1			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()



