code: 
  
  
  
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_flax_available,
      is_tf_available,
      is_tokenizers_available,
      is_torch_available,
  )
  
  
  __lowerCAmelCase     =			{
      "configuration_bart": ["BART_PRETRAINED_CONFIG_ARCHIVE_MAP", "BartConfig", "BartOnnxConfig"],
      "tokenization_bart": ["BartTokenizer"],
  }
  
  try:
      if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
      pass
  else:
      __lowerCAmelCase     =			["BartTokenizerFast"]
  
  try:
      if not is_torch_available():
          raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
      pass
  else:
      __lowerCAmelCase     =			[
          "BART_PRETRAINED_MODEL_ARCHIVE_LIST",
          "BartForCausalLM",
          "BartForConditionalGeneration",
          "BartForQuestionAnswering",
          "BartForSequenceClassification",
          "BartModel",
          "BartPretrainedModel",
          "PretrainedBartModel",
      ]
  
  try:
      if not is_tf_available():
          raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
      pass
  else:
      __lowerCAmelCase     =			[
          "TFBartForConditionalGeneration",
          "TFBartForSequenceClassification",
          "TFBartModel",
          "TFBartPretrainedModel",
      ]
  
  try:
      if not is_flax_available():
          raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
      pass
  else:
      __lowerCAmelCase     =			[
          "FlaxBartDecoderPreTrainedModel",
          "FlaxBartForCausalLM",
          "FlaxBartForConditionalGeneration",
          "FlaxBartForQuestionAnswering",
          "FlaxBartForSequenceClassification",
          "FlaxBartModel",
          "FlaxBartPreTrainedModel",
      ]
  
  if TYPE_CHECKING:
      from .configuration_bart import BART_PRETRAINED_CONFIG_ARCHIVE_MAP, BartConfig, BartOnnxConfig
      from .tokenization_bart import BartTokenizer
  
      try:
          if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
          pass
      else:
          from .tokenization_bart_fast import BartTokenizerFast
  
      try:
          if not is_torch_available():
              raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
          pass
      else:
          from .modeling_bart import (
              BART_PRETRAINED_MODEL_ARCHIVE_LIST,
              BartForCausalLM,
              BartForConditionalGeneration,
              BartForQuestionAnswering,
              BartForSequenceClassification,
              BartModel,
              BartPretrainedModel,
              PretrainedBartModel,
          )
  
      try:
          if not is_tf_available():
              raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
          pass
      else:
          from .modeling_tf_bart import (
              TFBartForConditionalGeneration,
              TFBartForSequenceClassification,
              TFBartModel,
              TFBartPretrainedModel,
          )
  
      try:
          if not is_flax_available():
              raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
          pass
      else:
          from .modeling_flax_bart import (
              FlaxBartDecoderPreTrainedModel,
              FlaxBartForCausalLM,
              FlaxBartForConditionalGeneration,
              FlaxBartForQuestionAnswering,
              FlaxBartForSequenceClassification,
              FlaxBartModel,
              FlaxBartPreTrainedModel,
          )
  
  else:
      import sys
  
      __lowerCAmelCase     =			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  __lowerCAmelCase     =			{
      "0": 1,
      "1": 1,
      "2": 2,
      "3": 6,
      "4": 24,
      "5": 120,
      "6": 720,
      "7": 5_040,
      "8": 40_320,
      "9": 362_880,
  }
  
  __lowerCAmelCase     =			{145: 145}
  
  __lowerCAmelCase     =			{
      145: 0,
      169: 3,
      36_301: 3,
      1_454: 3,
      871: 2,
      45_361: 2,
      872: 2,
  }
  
  def     a						(      _lowercase   :     int       )     ->int:
  		if n in CACHE_SUM_DIGIT_FACTORIALS:
  				return CACHE_SUM_DIGIT_FACTORIALS[n]
  		UpperCamelCase__         =	sum(DIGIT_FACTORIALS[let] for let in str(_lowercase       )       )
  		UpperCamelCase__         =	ret
  		return ret
  
  def     a						(      _lowercase   :     int ,						_lowercase   :     set | None = None       )     ->int:
  		UpperCamelCase__         =	previous or set()
  		if n in CHAIN_LENGTH_CACHE:
  				return CHAIN_LENGTH_CACHE[n]
  		UpperCamelCase__         =	sum_digit_factorials(_lowercase       )
  		if next_number in previous:
  				UpperCamelCase__         =	0
  				return 0
  		else:
  				previous.add(_lowercase       )
  				UpperCamelCase__         =	1 + chain_length(_lowercase ,						_lowercase       )
  				UpperCamelCase__         =	ret
  				return ret
  
  def     a						(      _lowercase   :     int = 6_0 ,						_lowercase   :     int = 1_0_0_0_0_0_0       )     ->int:
  		return sum(1 for i in range(1 ,						_lowercase       ) if chain_length(_lowercase       ) == num_terms       )
  
  
  if __name__ == "__main__":
  				print(f"""{solution() = }""")
  
  
  
  
  
  