'''simple docstring'''

from __future__ import annotations

import unittest

from transformers import DebertaVaConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
  import tensorflow as tf

  from transformers import (
      TFDebertaVaForMaskedLM,
      TFDebertaVaForQuestionAnswering,
      TFDebertaVaForSequenceClassification,
      TFDebertaVaForTokenClassification,
      TFDebertaVaModel,
  )



class 			UpperCAmelCase  :





       '''simple docstring'''



       def __init__(						self	,   __lowerCAmelCase	,   __lowerCAmelCase=13	,   __lowerCAmelCase=7	,   __lowerCAmelCase=True	,   __lowerCAmelCase=True	,   __lowerCAmelCase=True	,   __lowerCAmelCase=True	,   __lowerCAmelCase=99	,   __lowerCAmelCase=32	,   __lowerCAmelCase=2	,   __lowerCAmelCase=4	,   __lowerCAmelCase=37	,   __lowerCAmelCase="gelu"	,   __lowerCAmelCase=0.1	,   __lowerCAmelCase=0.1	,   __lowerCAmelCase=512	,   __lowerCAmelCase=16	,   __lowerCAmelCase=2	,   __lowerCAmelCase=0.0_2	,   __lowerCAmelCase=False	,   __lowerCAmelCase=True	,   __lowerCAmelCase="None"	,   __lowerCAmelCase=3	,   __lowerCAmelCase=4	,   __lowerCAmelCase=None	,   )  ->  Tuple:
        lowercase__				:    Optional[Any]  =					parent
        lowercase__				:    Union[str, Any]  =					batch_size
        lowercase__				:    int  =					seq_length
        lowercase__				:    Tuple  =					is_training
        lowercase__				:    List[Any]  =					use_input_mask
        lowercase__				:    Optional[int]  =					use_token_type_ids
        lowercase__				:    str  =					use_labels
        lowercase__				:    str  =					vocab_size
        lowercase__				:    Optional[Any]  =					hidden_size
        lowercase__				:    List[Any]  =					num_hidden_layers
        lowercase__				:    Any  =					num_attention_heads
        lowercase__				:    Any  =					intermediate_size
        lowercase__				:    List[str]  =					hidden_act
        lowercase__				:    str  =					hidden_dropout_prob
        lowercase__				:    Tuple  =					attention_probs_dropout_prob
        lowercase__				:    Any  =					max_position_embeddings
        lowercase__				:    Dict  =					type_vocab_size
        lowercase__				:    Union[str, Any]  =					type_sequence_label_size
        lowercase__				:    Optional[int]  =					initializer_range
        lowercase__				:    Dict  =					num_labels
        lowercase__				:    Optional[Any]  =					num_choices
        lowercase__				:    Any  =					relative_attention
        lowercase__				:    Any  =					position_biased_input
        lowercase__				:    List[str]  =					pos_att_type
        lowercase__				:    Tuple  =					scope

       def _lowerCAmelCase(						self )  ->  str:
        lowercase__				:    List[str]  =					ids_tensor([self.batch_size, self.seq_length]	,   self.vocab_size )

        lowercase__				:    Dict  =					None
        if self.use_input_mask:
         lowercase__				:    Dict  =					random_attention_mask([self.batch_size, self.seq_length] )

        lowercase__				:    Tuple  =					None
        if self.use_token_type_ids:
         lowercase__				:    Any  =					ids_tensor([self.batch_size, self.seq_length]	,   self.type_vocab_size )

        lowercase__				:    str  =					None
        lowercase__				:    Tuple  =					None
        lowercase__				:    Optional[int]  =					None
        if self.use_labels:
         lowercase__				:    Dict  =					ids_tensor([self.batch_size]	,   self.type_sequence_label_size )
         lowercase__				:    Optional[int]  =					ids_tensor([self.batch_size, self.seq_length]	,   self.num_labels )

        lowercase__				:    List[Any]  =					DebertaVaConfig(
            vocab_size=self.vocab_size	,   hidden_size=self.hidden_size	,   num_hidden_layers=self.num_hidden_layers	,   num_attention_heads=self.num_attention_heads	,   intermediate_size=self.intermediate_size	,   hidden_act=self.hidden_act	,   hidden_dropout_prob=self.hidden_dropout_prob	,   attention_probs_dropout_prob=self.attention_probs_dropout_prob	,   max_position_embeddings=self.max_position_embeddings	,   type_vocab_size=self.type_vocab_size	,   relative_attention=self.relative_attention	,   position_biased_input=self.position_biased_input	,   initializer_range=self.initializer_range	,   return_dict=__lowerCAmelCase	,   )

        return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels

       def _lowerCAmelCase(						self	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase )  ->  Tuple:
        lowercase__				:    str  =					TFDebertaVaModel(config=__lowerCAmelCase )
        lowercase__				:    Any  =					{'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}

        lowercase__				:    Tuple  =					[input_ids, input_mask]
        lowercase__				:    Optional[int]  =					model(__lowerCAmelCase )

        lowercase__				:    int  =					model(__lowerCAmelCase )

        self.parent.assertEqual(result.last_hidden_state.shape	,   (self.batch_size, self.seq_length, self.hidden_size) )

       def _lowerCAmelCase(						self	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase )  ->  Any:
        lowercase__				:    Optional[Any]  =					TFDebertaVaForMaskedLM(config=__lowerCAmelCase )
        lowercase__				:    Optional[Any]  =					{
            '''input_ids''': input_ids,
            '''attention_mask''': input_mask,
            '''token_type_ids''': token_type_ids,
        }
        lowercase__				:    str  =					model(__lowerCAmelCase )
        self.parent.assertEqual(result.logits.shape	,   (self.batch_size, self.seq_length, self.vocab_size) )

       def _lowerCAmelCase(						self	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase )  ->  List[str]:
        lowercase__				:    List[str]  =					self.num_labels
        lowercase__				:    Union[str, Any]  =					TFDebertaVaForSequenceClassification(config=__lowerCAmelCase )
        lowercase__				:    Optional[Any]  =					{
            '''input_ids''': input_ids,
            '''attention_mask''': input_mask,
            '''token_type_ids''': token_type_ids,
        }

        lowercase__				:    Optional[int]  =					model(__lowerCAmelCase )
        self.parent.assertEqual(result.logits.shape	,   (self.batch_size, self.num_labels) )

       def _lowerCAmelCase(						self	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase )  ->  int:
        lowercase__				:    List[str]  =					self.num_labels
        lowercase__				:    Union[str, Any]  =					TFDebertaVaForTokenClassification(config=__lowerCAmelCase )
        lowercase__				:    List[Any]  =					{
            '''input_ids''': input_ids,
            '''attention_mask''': input_mask,
            '''token_type_ids''': token_type_ids,
        }
        lowercase__				:    Any  =					model(__lowerCAmelCase )
        self.parent.assertEqual(result.logits.shape	,   (self.batch_size, self.seq_length, self.num_labels) )

       def _lowerCAmelCase(						self	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase	,   __lowerCAmelCase )  ->  Union[str, Any]:
        lowercase__				:    Optional[Any]  =					TFDebertaVaForQuestionAnswering(config=__lowerCAmelCase )
        lowercase__				:    Any  =					{
            '''input_ids''': input_ids,
            '''attention_mask''': input_mask,
            '''token_type_ids''': token_type_ids,
        }

        lowercase__				:    Optional[Any]  =					model(__lowerCAmelCase )
        self.parent.assertEqual(result.start_logits.shape	,   (self.batch_size, self.seq_length) )
        self.parent.assertEqual(result.end_logits.shape	,   (self.batch_size, self.seq_length) )


       def _lowerCAmelCase(						self )  ->  str:
        lowercase__				:    Optional[int]  =					self.prepare_config_and_inputs()
        (
            (
            lowercase__
        ) ,							(
            lowercase__
        ) ,							(
            lowercase__
        ) ,							(
            lowercase__
        ) ,							(
            lowercase__
        ) ,							(
            lowercase__
        ) ,							(
            lowercase__
        ) ,							
        )				:    int  =					config_and_inputs
        lowercase__				:    Dict  =					{'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
        return config, inputs_dict



@require_tf
class 			UpperCAmelCase  (						a__    ,						a__    ,						unittest.TestCase					):





       '''simple docstring'''



       SCREAMING_SNAKE_CASE							=    (
           (
               TFDebertaVaModel,
               TFDebertaVaForMaskedLM,
               TFDebertaVaForQuestionAnswering,
               TFDebertaVaForSequenceClassification,
               TFDebertaVaForTokenClassification,
           )
           if is_tf_available()
           else ()
       )
       SCREAMING_SNAKE_CASE							=    (
           {
               "feature-extraction": TFDebertaVaModel,
               "fill-mask": TFDebertaVaForMaskedLM,
               "question-answering": TFDebertaVaForQuestionAnswering,
               "text-classification": TFDebertaVaForSequenceClassification,
               "token-classification": TFDebertaVaForTokenClassification,
               "zero-shot": TFDebertaVaForSequenceClassification,
           }
           if is_tf_available()
           else {}
       )

       SCREAMING_SNAKE_CASE							=    False
       SCREAMING_SNAKE_CASE							=    False

       def _lowerCAmelCase(						self )  ->  Union[str, Any]:
        lowercase__				:    Dict  =					TFDebertaVaModelTester(self )
        lowercase__				:    Dict  =					ConfigTester(self	,   config_class=__lowerCAmelCase	,   hidden_size=37 )

       def _lowerCAmelCase(						self )  ->  Optional[Any]:
        self.config_tester.run_common_tests()

       def _lowerCAmelCase(						self )  ->  Dict:
        lowercase__				:    Dict  =					self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*__lowerCAmelCase )

       def _lowerCAmelCase(						self )  ->  Dict:
        lowercase__				:    Any  =					self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_masked_lm(*__lowerCAmelCase )

       def _lowerCAmelCase(						self )  ->  Tuple:
        lowercase__				:    Union[str, Any]  =					self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_question_answering(*__lowerCAmelCase )

       def _lowerCAmelCase(						self )  ->  Dict:
        lowercase__				:    Union[str, Any]  =					self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_sequence_classification(*__lowerCAmelCase )

       def _lowerCAmelCase(						self )  ->  Tuple:
        lowercase__				:    List[Any]  =					self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_token_classification(*__lowerCAmelCase )


       @slow
       def _lowerCAmelCase(						self )  ->  Dict:
        lowercase__				:    List[Any]  =					TFDebertaVaModel.from_pretrained('''kamalkraj/deberta-v2-xlarge''' )
        self.assertIsNotNone(__lowerCAmelCase )



@require_tf
class 			UpperCAmelCase  (						unittest.TestCase					):





       '''simple docstring'''



       @unittest.skip(reason='''Model not available yet''' )
       def _lowerCAmelCase(						self )  ->  str:
        pass


       @slow
       def _lowerCAmelCase(						self )  ->  List[str]:
        lowercase__				:    Tuple  =					TFDebertaVaModel.from_pretrained('''kamalkraj/deberta-v2-xlarge''' )
        lowercase__				:    Tuple  =					tf.constant([[0, 31414, 232, 328, 740, 1140, 12695, 69, 46078, 1588, 2]] )
        lowercase__				:    Any  =					tf.constant([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]] )
        lowercase__				:    Union[str, Any]  =					model(__lowerCAmelCase	,   attention_mask=__lowerCAmelCase )[0]

        lowercase__				:    Optional[Any]  =					tf.constant(
            [[[0.2_3_5_6, 0.1_9_4_8, 0.0_3_6_9], [-0.1_0_6_3, 0.3_5_8_6, -0.5_1_5_2], [-0.6_3_9_9, -0.0_2_5_9, -0.2_5_2_5]]] )
        tf.debugging.assert_near(output[:, 1:4, 1:4]	,   __lowerCAmelCase	,   atol=1E-4 )


'''simple docstring'''

def 			__UpperCamelCase       (   UpperCAmelCase     ):
 lowercase__				:    Optional[int]  =					1
 for i in range(1		,     num + 1     ):
  fact *= i
 return fact
def 			__UpperCamelCase       (   UpperCAmelCase     ):
 lowercase__				:    Optional[Any]  =					0
 while number > 0:
  lowercase__				:    str  =					number % 10
  sum_of_digits += last_digit
  lowercase__				:    List[str]  =					number // 10  # Removing the last_digit from the given number
 return sum_of_digits
def 			__UpperCamelCase       (   UpperCAmelCase = 100     ):
 lowercase__				:    Optional[int]  =					factorial(UpperCAmelCase     )
 lowercase__				:    Dict  =					split_and_add(UpperCAmelCase     )
 return result


if __name__ == "__main__":
  print(solution(int(input("""Enter the Number: """).strip())))

