




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

import huggingface_hub.utils as hf_hub_utils
from tqdm import auto as tqdm_lib


lowerCAmelCase_						=			threading.Lock()
lowerCAmelCase_						=			None

lowerCAmelCase_						=			{
    'debug': logging.DEBUG,
    'info': logging.INFO,
    'warning': logging.WARNING,
    'error': logging.ERROR,
    'critical': logging.CRITICAL,
}

lowerCAmelCase_						=			logging.WARNING

lowerCAmelCase_						=			True






def  snake_case(    )			->							List[Any]:





     '''simple docstring'''


     lowercase :       Tuple       =			os.getenv('''TRANSFORMERS_VERBOSITY'''			,		__magic_name__   )
     if env_level_str:
          if env_level_str in log_levels:
               return log_levels[env_level_str]
          else:
               logging.getLogger().warning(
                   F"""Unknown option TRANSFORMERS_VERBOSITY={env_level_str}, """
                   F"""has to be one of: { ', '.join(log_levels.keys()   ) }"""   )
     return _default_log_level






def  snake_case(    )			->							str:





     '''simple docstring'''


     return __name__.split('''.'''   )[0]






def  snake_case(    )			->							logging.Logger:





     '''simple docstring'''


     return logging.getLogger(_get_library_name()   )






def  snake_case(    )			->							None:





     '''simple docstring'''


     global _default_handler

     with _lock:
          if _default_handler:
               # This library has already configured the library root logger.
               return
          lowercase :       List[Any]       =			logging.StreamHandler()  # Set sys.stderr as stream.
          lowercase :       Tuple       =			sys.stderr.flush

          # Apply our default configuration to the library root logger.
          lowercase :       str       =			_get_library_root_logger()
          library_root_logger.addHandler(_default_handler   )
          library_root_logger.setLevel(_get_default_logging_level()   )
          lowercase :       str       =			False






def  snake_case(    )			->							None:





     '''simple docstring'''


     global _default_handler

     with _lock:
          if not _default_handler:
               return

          lowercase :       Optional[Any]       =			_get_library_root_logger()
          library_root_logger.removeHandler(_default_handler   )
          library_root_logger.setLevel(logging.NOTSET   )
          lowercase :       str       =			None






def  snake_case(    )			->							int:





     '''simple docstring'''


     return log_levels






def  snake_case(    __magic_name__ = None   )			->							logging.Logger:





     '''simple docstring'''


     if name is None:
          lowercase :       Any       =			_get_library_name()

     _configure_library_root_logger()
     return logging.getLogger(__magic_name__   )






def  snake_case(    )			->							int:





     '''simple docstring'''


     _configure_library_root_logger()
     return _get_library_root_logger().getEffectiveLevel()






def  snake_case(    __magic_name__   )			->							None:





     '''simple docstring'''


     _configure_library_root_logger()
     _get_library_root_logger().setLevel(__magic_name__   )






def  snake_case(    )			->							str:





     '''simple docstring'''


     return set_verbosity(__magic_name__   )






def  snake_case(    )			->							Union[str, Any]:





     '''simple docstring'''


     return set_verbosity(__magic_name__   )






def  snake_case(    )			->							str:





     '''simple docstring'''


     return set_verbosity(__magic_name__   )






def  snake_case(    )			->							Union[str, Any]:





     '''simple docstring'''


     return set_verbosity(__magic_name__   )






def  snake_case(    )			->							None:





     '''simple docstring'''


     _configure_library_root_logger()

     assert _default_handler is not None
     _get_library_root_logger().removeHandler(_default_handler   )






def  snake_case(    )			->							None:





     '''simple docstring'''


     _configure_library_root_logger()

     assert _default_handler is not None
     _get_library_root_logger().addHandler(_default_handler   )






def  snake_case(    __magic_name__   )			->							None:





     '''simple docstring'''


     _configure_library_root_logger()

     assert handler is not None
     _get_library_root_logger().addHandler(__magic_name__   )






def  snake_case(    __magic_name__   )			->							None:





     '''simple docstring'''


     _configure_library_root_logger()

     assert handler is not None and handler not in _get_library_root_logger().handlers
     _get_library_root_logger().removeHandler(__magic_name__   )






def  snake_case(    )			->							None:





     '''simple docstring'''


     _configure_library_root_logger()
     lowercase :       List[Any]       =			False






def  snake_case(    )			->							None:





     '''simple docstring'''


     _configure_library_root_logger()
     lowercase :       Any       =			True






def  snake_case(    )			->							None:





     '''simple docstring'''


     lowercase :       Tuple       =			_get_library_root_logger().handlers

     for handler in handlers:
          lowercase :       Any       =			logging.Formatter('''[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s'''   )
          handler.setFormatter(__magic_name__   )






def  snake_case(    )			->							None:





     '''simple docstring'''


     lowercase :       Dict       =			_get_library_root_logger().handlers

     for handler in handlers:
          handler.setFormatter(__magic_name__   )






def  snake_case(    self			,		*__magic_name__			,		**__magic_name__   )			->							str:





     '''simple docstring'''


     lowercase :       Tuple       =			os.getenv('''TRANSFORMERS_NO_ADVISORY_WARNINGS'''			,		__magic_name__   )
     if no_advisory_warnings:
          return
     self.warning(*__magic_name__			,		**__magic_name__   )


lowerCAmelCase_						=			warning_advice






@functools.lru_cache(__magic_name__   )
def  snake_case(    self			,		*__magic_name__			,		**__magic_name__   )			->							List[str]:





     '''simple docstring'''


     self.warning(*__magic_name__			,		**__magic_name__   )


lowerCAmelCase_						=			warning_once
class 						_A :






  def __init__(  self		:     Dict				,						*_A		:     Dict				,						**_A		:     Dict				)		->   List[str]:  # pylint: disable=unused-argument






       """simple docstring"""







       lowercase :       Tuple       =			args[0] if args else None






  def __iter__(  self		:     str				)		->   List[Any]:






       """simple docstring"""







       return iter(self._iterator				)






  def __getattr__(  self		:     Dict				,						_A		:     Dict				)		->   List[str]:






       """simple docstring"""







       def empty_fn(*_A		:     Any				,						**_A		:     Optional[int]				):  # pylint: disable=unused-argument
            return

       return empty_fn






  def __enter__(  self		:     Optional[Any]				)		->   Optional[int]:






       """simple docstring"""







       return self






  def __exit__(  self		:     int				,						_A		:     Union[str, Any]				,						_A		:     Tuple				,						_A		:     int				)		->   Any:






       """simple docstring"""







       return


class 						_A :






  def __call__(  self		:     List[Any]				,						*_A		:     Optional[Any]				,						**_A		:     List[Any]				)		->   List[Any]:






       """simple docstring"""







       if _tqdm_active:
            return tqdm_lib.tqdm(*_A				,						**_A				)
       else:
            return EmptyTqdm(*_A				,						**_A				)






  def  __a      (  self		:     Tuple				,						*_A		:     Tuple				,						**_A		:     List[str]				)		->   int:






       """simple docstring"""







       lowercase :       Optional[int]       =			None
       if _tqdm_active:
            return tqdm_lib.tqdm.set_lock(*_A				,						**_A				)






  def  __a      (  self		:     Tuple				)		->   str:






       """simple docstring"""







       if _tqdm_active:
            return tqdm_lib.tqdm.get_lock()


lowerCAmelCase_						=			_tqdm_cls()






def  snake_case(    )			->							bool:





     '''simple docstring'''


     global _tqdm_active
     return bool(_tqdm_active   )






def  snake_case(    )			->							Dict:





     '''simple docstring'''


     global _tqdm_active
     lowercase :       str       =			True
     hf_hub_utils.enable_progress_bars()






def  snake_case(    )			->							List[Any]:





     '''simple docstring'''


     global _tqdm_active
     lowercase :       List[str]       =			False
     hf_hub_utils.disable_progress_bars()





lowerCAmelCase_						=			range(2, 20 + 1)
lowerCAmelCase_						=			[10**k for k in range(ks[-1] + 1)]
lowerCAmelCase_						=			{}






def  snake_case(    __magic_name__			,		__magic_name__			,		__magic_name__			,		__magic_name__   )			->							Any:





     '''simple docstring'''


     lowercase :       str       =			sum(a_i[j] for j in range(__magic_name__			,		len(__magic_name__   )   )   )
     lowercase :       Any       =			sum(a_i[j] * base[j] for j in range(min(len(__magic_name__   )			,		__magic_name__   )   )   )

     lowercase      ,	lowercase :       Optional[int]       =			0, 0
     lowercase :       str       =			n - i

     lowercase :       Optional[int]       =			memo.get(__magic_name__   )

     if sub_memo is not None:
          lowercase :       List[str]       =			sub_memo.get(__magic_name__   )

          if jumps is not None and len(__magic_name__   ) > 0:
               # find and make the largest jump without going over
               lowercase :       Dict       =			-1
               for _k in range(len(__magic_name__   ) - 1			,		-1			,		-1   ):
                    if jumps[_k][2] <= k and jumps[_k][1] <= max_dn:
                         lowercase :       Any       =			_k
                         break

               if max_jump >= 0:
                    lowercase      ,	lowercase      ,	lowercase :       List[str]       =			jumps[max_jump]
                    # since the difference between jumps is cached, add c
                    lowercase :       str       =			diff + c
                    for j in range(min(__magic_name__			,		len(__magic_name__   )   )   ):
                         lowercase      ,	lowercase :       Optional[Any]       =			divmod(__magic_name__			,		10   )
                    if new_c > 0:
                         add(__magic_name__			,		__magic_name__			,		__magic_name__   )

          else:
               lowercase :       Dict       =			[]
     else:
          lowercase :       Union[str, Any]       =			{c: []}
          lowercase :       Optional[Any]       =			sub_memo

     if dn >= max_dn or c + diff >= base[k]:
          return diff, dn

     if k > ks[0]:
          while True:
               # keep doing smaller jumps
               lowercase      ,	lowercase :       str       =			next_term(__magic_name__			,		k - 1			,		i + dn			,		__magic_name__   )
               diff += _diff
               dn += terms_jumped

               if dn >= max_dn or c + diff >= base[k]:
                    break
     else:
          # would be too small a jump, just compute sequential terms instead
          lowercase      ,	lowercase :       Optional[Any]       =			compute(__magic_name__			,		__magic_name__			,		i + dn			,		__magic_name__   )
          diff += _diff
          dn += terms_jumped

     lowercase :       Optional[Any]       =			sub_memo[c]

     # keep jumps sorted by # of terms skipped
     lowercase :       List[Any]       =			0
     while j < len(__magic_name__   ):
          if jumps[j][1] > dn:
               break
          j += 1

     # cache the jump for this value digitsum(b) and c
     sub_memo[c].insert(__magic_name__			,		(diff, dn, k)   )
     return (diff, dn)






def  snake_case(    __magic_name__			,		__magic_name__			,		__magic_name__			,		__magic_name__   )			->							Optional[int]:





     '''simple docstring'''


     if i >= n:
          return 0, i
     if k > len(__magic_name__   ):
          a_i.extend([0 for _ in range(k - len(__magic_name__   )   )]   )

     # note: a_i -> b * 10^k + c
     # ds_b -> digitsum(b)
     # ds_c -> digitsum(c)
     lowercase :       Optional[Any]       =			i
     lowercase      ,	lowercase      ,	lowercase :       List[str]       =			0, 0, 0
     for j in range(len(__magic_name__   )   ):
          if j >= k:
               ds_b += a_i[j]
          else:
               ds_c += a_i[j]

     while i < n:
          i += 1
          lowercase :       List[str]       =			ds_c + ds_b
          diff += addend
          lowercase :       Tuple       =			0
          for j in range(__magic_name__   ):
               lowercase :       int       =			a_i[j] + addend
               lowercase      ,	lowercase :       Any       =			divmod(__magic_name__			,		10   )

               ds_c += a_i[j]

          if addend > 0:
               break

     if addend > 0:
          add(__magic_name__			,		__magic_name__			,		__magic_name__   )
     return diff, i - start_i






def  snake_case(    __magic_name__			,		__magic_name__			,		__magic_name__   )			->							Tuple:





     '''simple docstring'''


     for j in range(__magic_name__			,		len(__magic_name__   )   ):
          lowercase :       Any       =			digits[j] + addend
          if s >= 10:
               lowercase      ,	lowercase :       List[str]       =			divmod(__magic_name__			,		10   )
               lowercase :       List[str]       =			addend // 10 + quotient
          else:
               lowercase :       Optional[Any]       =			s
               lowercase :       Tuple       =			addend // 10

          if addend == 0:
               break

     while addend > 0:
          lowercase      ,	lowercase :       str       =			divmod(__magic_name__			,		10   )
          digits.append(__magic_name__   )






def  snake_case(    __magic_name__ = 10**15   )			->							int:





     '''simple docstring'''


     lowercase :       List[Any]       =			[1]
     lowercase :       List[Any]       =			1
     lowercase :       str       =			0
     while True:
          lowercase      ,	lowercase :       str       =			next_term(__magic_name__			,		20			,		i + dn			,		__magic_name__   )
          dn += terms_jumped
          if dn == n - i:
               break

     lowercase :       str       =			0
     for j in range(len(__magic_name__   )   ):
          a_n += digits[j] * 10**j
     return a_n


if __name__ == "__main__":
 print(f'''{solution() = }''')