





import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


__lowerCamelCase			:	Union[str, Any]					    =	{
    'debug': logging.DEBUG,
    'info': logging.INFO,
    'warning': logging.WARNING,
    'error': logging.ERROR,
    'critical': logging.CRITICAL,
}

__lowerCamelCase			:	List[Any]					    =	logging.WARNING



def 						A_							(	)		->					Union[str, Any]:
 UpperCamelCase      :   Tuple			      =  os.getenv("DATASETS_VERBOSITY"				,  lowerCAmelCase__	)
 if env_level_str:
  if env_level_str in log_levels:
   return log_levels[env_level_str]
  else:
   logging.getLogger().warning(
       F"""Unknown option DATASETS_VERBOSITY={env_level_str}, """
       F"""has to be one of: { ", ".join(log_levels.keys()	) }"""	)
 return _default_log_level



def 						A_							(	)		->					str:
 return __name__.split("."	)[0]



def 						A_							(	)		->					logging.Logger:
 return logging.getLogger(_get_library_name()	)



def 						A_							(	)		->					None:
 UpperCamelCase      :   Union[str, Any]			      =  _get_library_root_logger()
 library_root_logger.setLevel(_get_default_logging_level()	)



def 						A_							(	)		->					None:
 UpperCamelCase      :   Union[str, Any]			      =  _get_library_root_logger()
 library_root_logger.setLevel(logging.NOTSET	)



def 						A_							(	_lowerCAmelCase = None	)		->					logging.Logger:






 if name is None:
  UpperCamelCase      :   Optional[Any]			      =  _get_library_name()
 return logging.getLogger(lowerCAmelCase__	)



def 						A_							(	)		->					int:
 return _get_library_root_logger().getEffectiveLevel()



def 						A_							(	_lowerCAmelCase	)		->					None:
 _get_library_root_logger().setLevel(lowerCAmelCase__	)



def 						A_							(	)		->					List[Any]:
 return set_verbosity(lowerCAmelCase__	)



def 						A_							(	)		->					List[Any]:
 return set_verbosity(lowerCAmelCase__	)



def 						A_							(	)		->					Union[str, Any]:
 return set_verbosity(lowerCAmelCase__	)



def 						A_							(	)		->					Optional[int]:
 return set_verbosity(lowerCAmelCase__	)



def 						A_							(	)		->					None:
 UpperCamelCase      :   Optional[int]			      =  False



def 						A_							(	)		->					None:
 UpperCamelCase      :   Optional[Any]			      =  True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()



class    A__  :





      def __init__(					self			,				*A_			,				**A_  ):  # pylint: disable=unused-argument
       '''simple docstring'''




       UpperCamelCase      :   int			      =  args[0] if args else None





      def __iter__(					self  ):
       '''simple docstring'''




       return iter(self._iterator  )





      def __getattr__(					self			,				A_  ):
       '''simple docstring'''




       def empty_fn(*A_			,				**A_  ):  # pylint: disable=unused-argument
        return

       return empty_fn





      def __enter__(					self  ):
       '''simple docstring'''




       return self





      def __exit__(					self			,				A_			,				A_			,				A_  ):
       '''simple docstring'''




       return


__lowerCamelCase			:	Tuple					    =	True



class    A__  :





      def __call__(					self			,				*A_			,				A_=False			,				**A_  ):
       '''simple docstring'''




       if _tqdm_active and not disable:
        return tqdm_lib.tqdm(*__UpperCamelCase			,				**__UpperCamelCase  )
       else:
        return EmptyTqdm(*__UpperCamelCase			,				**__UpperCamelCase  )





      def 			__UpperCamelCase(					self			,				*A_			,				**A_  ):
       '''simple docstring'''




       UpperCamelCase      :   Any			      =  None
       if _tqdm_active:
        return tqdm_lib.tqdm.set_lock(*__UpperCamelCase			,				**__UpperCamelCase  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       if _tqdm_active:
        return tqdm_lib.tqdm.get_lock()


__lowerCamelCase			:	int					    =	_tqdm_cls()



def 						A_							(	)		->					bool:
 global _tqdm_active
 return bool(_tqdm_active	)



def 						A_							(	)		->					Tuple:
 global _tqdm_active
 UpperCamelCase      :   Dict			      =  True



def 						A_							(	)		->					Dict:
 global _tqdm_active
 UpperCamelCase      :   int			      =  False





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))