
def 	UpperCAmelCase   (						_lowerCamelCase ,    _lowerCamelCase    ):
			while a != 0:
						A							:					Dict              =						b % a, a
			return b






def 	UpperCAmelCase   (						_lowerCamelCase ,    _lowerCamelCase    ):
			if gcd(_lowerCamelCase ,    _lowerCamelCase    ) != 1:
						A							:					Tuple              =						f"""mod inverse of {a!r} and {m!r} does not exist"""
						raise ValueError(_lowerCamelCase    )
			A							:					Optional[Any]              =						1, 0, a
			A							:					str              =						0, 1, m
			while va != 0:
						A							:					Optional[Any]              =						ua // va
						A							:					Union[str, Any]              =						(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
			return ua % m




from collections.abc import Sequence




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

			A							:					Dict              =						nums[0]
			for i in range(1 ,    len(_lowerCamelCase    )    ):
						A							:					Tuple              =						nums[i]
						A							:					List[Any]              =						max(_lowerCamelCase ,    ans + num ,    _lowerCamelCase    )

			return ans


if __name__ == "__main__":
							import doctest

							doctest.testmod()

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