






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    _lowerCAmelCase			:



				"""simple docstring"""



				def __init__(      self    :    List[str]			,		UpperCamelCase__    :    Dict			,		UpperCamelCase__    :    str=1_3			,		UpperCamelCase__    :    Dict=7			,		UpperCamelCase__    :    Optional[int]=True			,		UpperCamelCase__    :    Tuple=True			,		UpperCamelCase__    :    Union[str, Any]=True			,		UpperCamelCase__    :    Optional[int]=True			,		UpperCamelCase__    :    Optional[int]=9_9			,		UpperCamelCase__    :    int=3_2			,		UpperCamelCase__    :    List[Any]=2			,		UpperCamelCase__    :    Optional[Any]=4			,		UpperCamelCase__    :    str=3_7			,		UpperCamelCase__    :    Optional[Any]="gelu"			,		UpperCamelCase__    :    str=0.1			,		UpperCamelCase__    :    Any=0.1			,		UpperCamelCase__    :    List[str]=5_1_2			,		UpperCamelCase__    :    Optional[int]=1_6			,		UpperCamelCase__    :    Any=2			,		UpperCamelCase__    :    int=0.02			,		UpperCamelCase__    :    Union[str, Any]=False			,		UpperCamelCase__    :    str=True			,		UpperCamelCase__    :    int="None"			,		UpperCamelCase__    :    Any=3			,		UpperCamelCase__    :    int=4			,		UpperCamelCase__    :    Optional[int]=None			,		):






											'''simple docstring'''







											snake_case__	  =       parent
											snake_case__	  =       batch_size
											snake_case__	  =       seq_length
											snake_case__	  =       is_training
											snake_case__	  =       use_input_mask
											snake_case__	  =       use_token_type_ids
											snake_case__	  =       use_labels
											snake_case__	  =       vocab_size
											snake_case__	  =       hidden_size
											snake_case__	  =       num_hidden_layers
											snake_case__	  =       num_attention_heads
											snake_case__	  =       intermediate_size
											snake_case__	  =       hidden_act
											snake_case__	  =       hidden_dropout_prob
											snake_case__	  =       attention_probs_dropout_prob
											snake_case__	  =       max_position_embeddings
											snake_case__	  =       type_vocab_size
											snake_case__	  =       type_sequence_label_size
											snake_case__	  =       initializer_range
											snake_case__	  =       num_labels
											snake_case__	  =       num_choices
											snake_case__	  =       relative_attention
											snake_case__	  =       position_biased_input
											snake_case__	  =       pos_att_type
											snake_case__	  =       scope



				def 					__magic_name__							(      self    :    Any):






											'''simple docstring'''







											snake_case__	  =       ids_tensor([self.batch_size, self.seq_length]			,		self.vocab_size)

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

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

											snake_case__	  =       None
											snake_case__	  =       None
											snake_case__	  =       None
											if self.use_labels:
																		snake_case__	  =       ids_tensor([self.batch_size]			,		self.type_sequence_label_size)
																		snake_case__	  =       ids_tensor([self.batch_size, self.seq_length]			,		self.num_labels)

											snake_case__	  =       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=UpperCamelCase__			,		)

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



				def 					__magic_name__							(      self    :    Optional[int]			,		UpperCamelCase__    :    List[str]			,		UpperCamelCase__    :    Tuple			,		UpperCamelCase__    :    Optional[Any]			,		UpperCamelCase__    :    Union[str, Any]			,		UpperCamelCase__    :    str			,		UpperCamelCase__    :    Optional[int]			,		UpperCamelCase__    :    Union[str, Any]):






											'''simple docstring'''







											snake_case__	  =       TFDebertaVaModel(config=UpperCamelCase__)
											snake_case__	  =       {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}

											snake_case__	  =       [input_ids, input_mask]
											snake_case__	  =       model(UpperCamelCase__)

											snake_case__	  =       model(UpperCamelCase__)

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



				def 					__magic_name__							(      self    :    Optional[int]			,		UpperCamelCase__    :    Optional[Any]			,		UpperCamelCase__    :    int			,		UpperCamelCase__    :    Union[str, Any]			,		UpperCamelCase__    :    Any			,		UpperCamelCase__    :    List[str]			,		UpperCamelCase__    :    Union[str, Any]			,		UpperCamelCase__    :    Tuple):






											'''simple docstring'''







											snake_case__	  =       TFDebertaVaForMaskedLM(config=UpperCamelCase__)
											snake_case__	  =       {
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}
											snake_case__	  =       model(UpperCamelCase__)
											self.parent.assertEqual(result.logits.shape			,		(self.batch_size, self.seq_length, self.vocab_size))



				def 					__magic_name__							(      self    :    Tuple			,		UpperCamelCase__    :    List[Any]			,		UpperCamelCase__    :    Optional[int]			,		UpperCamelCase__    :    Tuple			,		UpperCamelCase__    :    Optional[Any]			,		UpperCamelCase__    :    Union[str, Any]			,		UpperCamelCase__    :    Any			,		UpperCamelCase__    :    Union[str, Any]):






											'''simple docstring'''







											snake_case__	  =       self.num_labels
											snake_case__	  =       TFDebertaVaForSequenceClassification(config=UpperCamelCase__)
											snake_case__	  =       {
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}

											snake_case__	  =       model(UpperCamelCase__)
											self.parent.assertEqual(result.logits.shape			,		(self.batch_size, self.num_labels))



				def 					__magic_name__							(      self    :    int			,		UpperCamelCase__    :    Dict			,		UpperCamelCase__    :    Optional[Any]			,		UpperCamelCase__    :    List[str]			,		UpperCamelCase__    :    Optional[int]			,		UpperCamelCase__    :    Optional[int]			,		UpperCamelCase__    :    Optional[Any]			,		UpperCamelCase__    :    Any):






											'''simple docstring'''







											snake_case__	  =       self.num_labels
											snake_case__	  =       TFDebertaVaForTokenClassification(config=UpperCamelCase__)
											snake_case__	  =       {
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}
											snake_case__	  =       model(UpperCamelCase__)
											self.parent.assertEqual(result.logits.shape			,		(self.batch_size, self.seq_length, self.num_labels))



				def 					__magic_name__							(      self    :    Tuple			,		UpperCamelCase__    :    Union[str, Any]			,		UpperCamelCase__    :    Optional[Any]			,		UpperCamelCase__    :    List[Any]			,		UpperCamelCase__    :    Dict			,		UpperCamelCase__    :    Dict			,		UpperCamelCase__    :    Dict			,		UpperCamelCase__    :    int):






											'''simple docstring'''







											snake_case__	  =       TFDebertaVaForQuestionAnswering(config=UpperCamelCase__)
											snake_case__	  =       {
											    'input_ids': input_ids,
											    'attention_mask': input_mask,
											    'token_type_ids': token_type_ids,
											}

											snake_case__	  =       model(UpperCamelCase__)
											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 					__magic_name__							(      self    :    Any):






											'''simple docstring'''







											snake_case__	  =       self.prepare_config_and_inputs()
											(
											    snake_case__       
											)	  =       config_and_inputs
											snake_case__	  =       {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
											return config, inputs_dict


@require_tf
class    _lowerCAmelCase			(		__A     ,      __A     ,      unittest.TestCase      ):



				"""simple docstring"""



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

				_lowercase				:   Optional[int]      =					False
				_lowercase				:   str      =					False



				def 					__magic_name__							(      self    :    Optional[int]):






											'''simple docstring'''







											snake_case__	  =       TFDebertaVaModelTester(self)
											snake_case__	  =       ConfigTester(self			,		config_class=UpperCamelCase__			,		hidden_size=3_7)



				def 					__magic_name__							(      self    :    Optional[int]):






											'''simple docstring'''







											self.config_tester.run_common_tests()



				def 					__magic_name__							(      self    :    Any):






											'''simple docstring'''







											snake_case__	  =       self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_model(*UpperCamelCase__)



				def 					__magic_name__							(      self    :    List[str]):






											'''simple docstring'''







											snake_case__	  =       self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_masked_lm(*UpperCamelCase__)



				def 					__magic_name__							(      self    :    List[str]):






											'''simple docstring'''







											snake_case__	  =       self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_question_answering(*UpperCamelCase__)



				def 					__magic_name__							(      self    :    List[Any]):






											'''simple docstring'''







											snake_case__	  =       self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_sequence_classification(*UpperCamelCase__)



				def 					__magic_name__							(      self    :    int):






											'''simple docstring'''







											snake_case__	  =       self.model_tester.prepare_config_and_inputs()
											self.model_tester.create_and_check_for_token_classification(*UpperCamelCase__)



				@slow
				def 					__magic_name__							(      self    :    List[Any]):






											'''simple docstring'''







											snake_case__	  =       TFDebertaVaModel.from_pretrained("""kamalkraj/deberta-v2-xlarge""")
											self.assertIsNotNone(UpperCamelCase__)


@require_tf
class    _lowerCAmelCase			(		unittest.TestCase      ):



				"""simple docstring"""



				@unittest.skip(reason="""Model not available yet""")
				def 					__magic_name__							(      self    :    Optional[int]):






											'''simple docstring'''







											pass



				@slow
				def 					__magic_name__							(      self    :    Optional[int]):






											'''simple docstring'''







											snake_case__	  =       TFDebertaVaModel.from_pretrained("""kamalkraj/deberta-v2-xlarge""")
											snake_case__	  =       tf.constant([[0, 3_1_4_1_4, 2_3_2, 3_2_8, 7_4_0, 1_1_4_0, 1_2_6_9_5, 6_9, 4_6_0_7_8, 1_5_8_8, 2]])
											snake_case__	  =       tf.constant([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
											snake_case__	  =       model(UpperCamelCase__			,		attention_mask=UpperCamelCase__)[0]

											snake_case__	  =       tf.constant(
											    [[[0.23_56, 0.19_48, 0.03_69], [-0.10_63, 0.35_86, -0.51_52], [-0.63_99, -0.02_59, -0.25_25]]])
											tf.debugging.assert_near(output[:, 1:4, 1:4]			,		UpperCamelCase__			,		atol=1E-4)








def _UpperCAmelCase   (	a						:	int = 1000 ):
							snake_case__  , snake_case__	  =       1, 1
							snake_case__	  =       2
							while True:
														snake_case__	  =       0
														snake_case__	  =       fa + fa
														snake_case__  , snake_case__	  =       fa, f
														index += 1
														for _ in str(a ):
																					i += 1
														if i == n:
																					break
							return index


if __name__ == "__main__":
	print(solution(int(str(input()).strip())))
