



from collections import deque

from .hash_table import HashTable



class        lowerCAmelCase__					(  _lowerCamelCase       ):


				def __init__(							self      :  Optional[int]						, *__UpperCamelCase      :  Dict						, **__UpperCamelCase      :  int       )		->     List[Any]:
											super().__init__(*__UpperCamelCase						, **__UpperCamelCase       )


				def __UpperCamelCase						(							self      :  Dict						, __UpperCamelCase      :  int						, __UpperCamelCase      :  Optional[Any]       )		->     str:
											A      						=    deque([]       ) if self.values[key] is None else self.values[key]
											self.values[key].appendleft(__UpperCamelCase       )
											A      						=    self.values[key]


				def __UpperCamelCase						(							self      :  Union[str, Any]       )		->     Tuple:
											return (
											    sum(self.charge_factor - len(__UpperCamelCase       ) for slot in self.values       )
											    / self.size_table
											    * self.charge_factor
											)


				def __UpperCamelCase						(							self      :  str						, __UpperCamelCase      :  Dict						, __UpperCamelCase      :  Any=None       )		->     str:
											if not (
											    len(self.values[key]       ) == self.charge_factor and self.values.count(__UpperCamelCase       ) == 0
											):
																		return key
											return super()._collision_resolution(__UpperCamelCase						, __UpperCamelCase       )




from collections.abc import Sequence






def  lowerCamelCase_	(      lowerCAmelCase__	:	Sequence[int] | None = None				)       ->							int:

							'''simple docstring'''






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

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

							return ans


if __name__ == "__main__":
				import doctest

				doctest.testmod()

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